Added "check_cd" function to "fx doctor"

verify "cd" does not output anything to stdout, since many
other scripts assume this.

Note that check_cd optionally prints recommendations for
resolving the issue within the developer's shell environment.

For bash users only, doctor calls
scripts/devshell/lib/bashrc_checkup.sh,
which will attempt to load their ~/.bashrc
file, to allow doctor to check for conflicts in the interactive
shell environment (e.g., functions like overriding "cd").

For users using non-bash shells (like zsh) this current iteration
of "doctor" will still check environment variables and files
through the non-interactive bash script, but we may want to add
a "zshrc_checkup.zsh" script as well if we want to check for zsh-specific
interactive shell conflicts. (The bash "doctor" could still
launch other non-bash shell checks.)

Updated "doctor" script format and error handling a bit. Needs more
work to be easier to use and easier to add more checks.

Added --indent flag to style.sh and moved common terminal output
style functions, originally in doctor, to
devshell/lib/common_term_styles.sh, for reusability.

Change-Id: I3b054609e87274f49479c93c3a6c2e29bb7136eb
11 files changed
tree: cf1d87926e18fce7d452862849bc2ec0b2b4d9cc
  1. crash/
  2. dart/
  3. devshell/
  4. editors/
  5. gce/
  6. gdb/
  7. manifest/
  8. memory/
  9. packages/
  10. rust/
  11. sdk/
  12. style/
  13. tests/
  14. third_party/
  15. vim/
  16. youcompleteme/
  17. zsh-completion/
  18. .gitignore
  19. AUTHORS
  20. bootstrap
  21. build-qemu.sh
  22. build-zircon.sh
  23. build_id_conv.py
  24. check-gn-format
  25. colorize_logs
  26. CONTRIBUTING.md
  27. fd.py
  28. fetch-build-artifacts
  29. find_integration_revision.py
  30. flog
  31. fx
  32. fx-env.sh
  33. fx-wrapper
  34. generate-intellij-config.py
  35. git-file-tidy
  36. git-fuchsia-review
  37. git_utils.py
  38. gn_to_cmake.py
  39. LICENSE
  40. list-available-packages.py
  41. MAINTAINERS
  42. PATENTS
  43. paths.py
  44. README.md
  45. run-dart-action.py
  46. run-zircon-arm64
  47. run-zircon-x86
  48. start-dhcp-server.sh
  49. update-manifest.go
README.md

Scripts

This repository is for scripts useful when hacking on Fuchsia. This repository should contain scripts that perform tasks spanning multiple repositories. Scripts that only operate within a single repository should live in the relevant repository.

push-package.py

The push-package.py script pushes the files listed in the given manifests files. No checking is performed for incremental changes.

The sample command lines below can be used to build Modular and then push those files to the default device. This assumes you have already booted your device with a version of Fuchsia that contains the most recent version of all other packages. This command line uses the “system_manifest” file from each of the modular directories, such as modular, modular_dev, and modular_tests.

cd $FUCHSIA_DIR
fx build peridot:modular_all
scripts/push-package.py out/debug-x64/package/modular*/system_manifest

fx publish

fx publish will take a package from the build and create a Fuchsia package manager package from a build package. It will then add the package to a local update respository which, by default, is put at ${FUCHSIA_BUILD_DIR}/amber-files. It will also add the package content files to the update repository and name these file after their Merkle Root. If a package name is supplied to fx publish, only that package will be processed. If no name is supplied, all the packages made by the build will be included.