Skip to content

Commit

Permalink
Merge pull request #1264 from konstin/konsti/dont-modify-path-if-alre…
Browse files Browse the repository at this point in the history
…ady-in-path

Don't modify dotfiles when install dir is already in PATH
  • Loading branch information
mistydemeo authored Aug 7, 2024
2 parents 12066a0 + 6505eca commit e55ac7b
Show file tree
Hide file tree
Showing 44 changed files with 270 additions and 23 deletions.
6 changes: 6 additions & 0 deletions cargo-dist/templates/installer/installer.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,12 @@ install() {

say "{{ install_success_msg }}"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
7 changes: 6 additions & 1 deletion cargo-dist/tests/snapshots/akaikatana_basic.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: cargo-dist/tests/gallery/dist/snapshot.rs
assertion_line: 92
expression: self.payload
---
================ akaikatana-repack-installer.sh ================
Expand Down Expand Up @@ -486,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
7 changes: 6 additions & 1 deletion cargo-dist/tests/snapshots/akaikatana_musl.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: cargo-dist/tests/gallery/dist/snapshot.rs
assertion_line: 92
expression: self.payload
---
================ akaikatana-repack-installer.sh ================
Expand Down Expand Up @@ -508,6 +507,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: cargo-dist/tests/gallery/dist/snapshot.rs
assertion_line: 92
expression: self.payload
---
================ akaikatana-repack-installer.sh ================
Expand Down Expand Up @@ -498,6 +497,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
7 changes: 6 additions & 1 deletion cargo-dist/tests/snapshots/akaikatana_two_bin_aliases.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: cargo-dist/tests/gallery/dist/snapshot.rs
assertion_line: 92
expression: self.payload
---
================ akaikatana-repack-installer.sh ================
Expand Down Expand Up @@ -510,6 +509,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
7 changes: 6 additions & 1 deletion cargo-dist/tests/snapshots/akaikatana_updaters.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: cargo-dist/tests/gallery/dist/snapshot.rs
assertion_line: 92
expression: self.payload
---
================ akaikatana-repack-installer.sh ================
Expand Down Expand Up @@ -486,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
6 changes: 6 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_abyss.snap
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
6 changes: 6 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
6 changes: 6 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_alias.snap
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
6 changes: 6 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_basic.snap
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ install() {

say ">o_o< everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
6 changes: 6 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
6 changes: 6 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ install() {

say ">o_o< everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
7 changes: 6 additions & 1 deletion cargo-dist/tests/snapshots/axolotlsay_checksum_blake2b.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: cargo-dist/tests/gallery/dist/snapshot.rs
assertion_line: 92
expression: self.payload
---
================ axolotlsay-installer.sh ================
Expand Down Expand Up @@ -486,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
7 changes: 6 additions & 1 deletion cargo-dist/tests/snapshots/axolotlsay_checksum_blake2s.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: cargo-dist/tests/gallery/dist/snapshot.rs
assertion_line: 92
expression: self.payload
---
================ axolotlsay-installer.sh ================
Expand Down Expand Up @@ -486,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
7 changes: 6 additions & 1 deletion cargo-dist/tests/snapshots/axolotlsay_checksum_sha3_256.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: cargo-dist/tests/gallery/dist/snapshot.rs
assertion_line: 92
expression: self.payload
---
================ axolotlsay-installer.sh ================
Expand Down Expand Up @@ -486,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
7 changes: 6 additions & 1 deletion cargo-dist/tests/snapshots/axolotlsay_checksum_sha3_512.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: cargo-dist/tests/gallery/dist/snapshot.rs
assertion_line: 92
expression: self.payload
---
================ axolotlsay-installer.sh ================
Expand Down Expand Up @@ -486,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
6 changes: 6 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: cargo-dist/tests/gallery/dist/snapshot.rs
assertion_line: 106
expression: self.payload
---
================ axolotlsay-js-installer.sh ================
Expand Down Expand Up @@ -486,6 +485,12 @@ install() {

say ">o_o< everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down Expand Up @@ -2045,6 +2050,12 @@ install() {

say ">o_o< everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
6 changes: 6 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_homebrew_packages.snap
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
6 changes: 6 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_musl.snap
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
6 changes: 6 additions & 0 deletions cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ install() {

say "everything's installed!"

# Avoid modifying the users PATH if they are managing their PATH manually
case :$PATH:
in *:$_install_dir:*) NO_MODIFY_PATH=1 ;;
*) ;;
esac

if [ "0" = "$NO_MODIFY_PATH" ]; then
add_install_dir_to_ci_path "$_install_dir"
add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" "sh"
Expand Down
Loading

0 comments on commit e55ac7b

Please sign in to comment.