Skip to content

Commit

Permalink
fish: Add and use $PYTHON_SETUP_FOLDER
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Dec 8, 2024
1 parent 4bf3aad commit 3ec1d31
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions fish/conf.d/variables.fish
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ set -gx FORKS_FOLDER $GITHUB_FOLDER/forks
set -gx PYTHON_FOLDER $ENV_FOLDER/python
set -gx PYTHON_LIB_FOLDER $PYTHON_FOLDER/lib
set -gx PYTHON_SCRIPTS_FOLDER $PYTHON_FOLDER/scripts
set -gx PYTHON_SETUP_FOLDER $PYTHON_FOLDER/setup

set -gx TMP_BUILD_FOLDER $TMP_FOLDER/build

Expand Down
4 changes: 2 additions & 2 deletions fish/functions/add_hetzner_mirror_to_repos.fish
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if orig_pacman_conf_txt != new_pacman_conf_txt:
pacman_conf.write_text(new_pacman_conf_txt, encoding='utf-8')"

if test (count $argv) -eq 0
sudo env PYTHONPATH=$PYTHON_FOLDER/setup python -c "$program"
sudo env PYTHONPATH=$PYTHON_SETUP_FOLDER python -c "$program"
return
end

Expand All @@ -28,7 +28,7 @@ if orig_pacman_conf_txt != new_pacman_conf_txt:
printf '\n%s\n%s\n%s%s%s\n%s\n' \
'# Import Hetzner mirror from the host configuration if using pacman' \
'if command -v python3 >/dev/null 2>&1; then' \
' PYTHONPATH=/run/host'$PYTHON_FOLDER'/setup python3 -c "' \
' PYTHONPATH=/run/host'$PYTHON_SETUP_FOLDER' python3 -c "' \
"$program" \
'" || exit' \
fi
Expand Down
2 changes: 1 addition & 1 deletion fish/functions/is_hetzner.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ function is_hetzner -d "Checks if current running machine is a Hetzner machine"
if test $LOCATION = hetzner # duh
return 0
end
PYTHONPATH=$PYTHON_FOLDER/setup python3 -c 'from arch import is_hetzner; import sys; sys.exit(0 if is_hetzner() else 1)'
PYTHONPATH=$PYTHON_SETUP_FOLDER python3 -c 'from arch import is_hetzner; import sys; sys.exit(0 if is_hetzner() else 1)'
end

0 comments on commit 3ec1d31

Please sign in to comment.