Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for updates when starting a new shell. #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/autoparts/commands/init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def show_help
# Load environment variables for Autoparts automatically by
# adding the following to #{profile}

eval "$(parts env)"
eval "$(parts init -)"
STR
end

Expand Down
2 changes: 1 addition & 1 deletion script/setup_buildenv
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ urlencoding_mode = normal
use_https = False
verbosity = WARNING" > /home/action/.s3cfg

eval "$(parts env)"
eval "$(parts init -)"
exec /bin/bash
2 changes: 1 addition & 1 deletion setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def inject_parts_init(path)
file = File.read(path)
File.open(path, 'a') do |f|
export_path = "export PATH=\"$HOME/#{relative_autoparts_bin_path}:$PATH\"\n"
parts_init = "eval \"$(parts env)\"\n"
parts_init = "eval \"$(parts init -)\"\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because parts_init var is changed here, line 32 file.include? parts_init condition will mean that the file can potentially have two lines, one for evalling parts env the other for evalling parts init.

Which I guess is fine, but something to watch out for in the future if we change it back.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm..but I guess it would be rare for someone to run the setup script, if they have Autoparts already installed?

f.write "\n"
f.write export_path unless file.include? export_path
f.write parts_init unless file.include? parts_init
Expand Down