Skip to content

Fix a bug causing the shell user to logout on script completion #5

@FacuM

Description

@FacuM

Current behavior:
Most of the scripts in this repository will cause the user to logout from the current shell by calling exit if the script is unexpectedly sourced i.e.: . ~/shellscripts/shell/uploadtg/uploadtg.sh.

Expected behavior:
A message similar to the one found on android/buildrom/buildrom.sh should be displayed.

This script must be run from the source shell.

Usage:
  .      configname.sh [reset]|[clobber]|[ns] [release notes] [maintainership] [testers]
  source configname.sh [reset]|[clobber]|[ns] [release notes] [maintainership] [testers]
reset - Remove old source (if existing) before building.
clobber - Clean environment before building.
ns - Do not sync, just build.
js - Just sync, do not build.
Do not run the script directly, call your configuration script instead.

Solution:
Mimic the behavior of buildrom.sh (android/buildrom/buildrom.sh) so that all of the scripts seen by android/ and shell/ don't cause this issue.

There are no extra requirements other than Hacktoberfest's rules, have fun!

Feel free to get creative and send any other unrelated PR that you find relevant to the content of the repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions