@leverege/build-tools 2.52.0-pedro.2 → 2.52.0-pedro.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.52.0-pedro.2",
3
+ "version": "2.52.0-pedro.4",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -84,6 +84,52 @@ password: $ENCODED_KEY
84
84
  EOF
85
85
  echo "Updated $HOME/.pypirc"
86
86
 
87
- # Set UV_EXTRA_INDEX_URL env var
88
- export UV_EXTRA_INDEX_URL="https://_json_key_base64:$ENCODED_KEY@us-python.pkg.dev/leverege-registry/leverege-python-packages/simple"
89
- echo "Updated UV_EXTRA_INDEX_URL"
87
+
88
+ UV_EXTRA_INDEX_URL="https://_json_key_base64:$ENCODED_KEY@us-python.pkg.dev/leverege-registry/leverege-python-packages/simple"
89
+ UV_EXTRA_INDEX_URL_E=$(escape_for_sed "$UV_EXTRA_INDEX_URL")
90
+
91
+ # List of shell configuration files to update
92
+ SHELLS=("bash" "zsh" "fish")
93
+
94
+ for SHELL in "${SHELLS[@]}"; do
95
+ if command -v "$SHELL" >/dev/null 2>&1; then
96
+ case "$SHELL" in
97
+ bash)
98
+ config_file="${HOME}/.bashrc"
99
+ ;;
100
+ zsh)
101
+ config_file="${HOME}/.zshrc"
102
+ ;;
103
+ fish)
104
+ config_file="${HOME}/.config/fish/config.fish"
105
+ ;;
106
+ *)
107
+ echo "Shell $SHELL is not supported."
108
+ continue
109
+ ;;
110
+ esac
111
+
112
+ echo "Updating shell configuration in $config_file"
113
+
114
+ if grep -q "UV_EXTRA_INDEX_URL" "$config_file"; then
115
+ if [ "$SHELL" = "fish" ]; then
116
+ sed -i '' "s|set -x UV_EXTRA_INDEX_URL .*|set -x UV_EXTRA_INDEX_URL $UV_EXTRA_INDEX_URL_E|" "$config_file"
117
+ else
118
+ sed -i '' "s|export UV_EXTRA_INDEX_URL=.*|export UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL_E|" "$config_file"
119
+ fi
120
+ else
121
+ if [ "$SHELL" = "fish" ]; then
122
+ echo "set -x UV_EXTRA_INDEX_URL $UV_EXTRA_INDEX_URL" >> "$config_file"
123
+ else
124
+ echo "export UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL" >> "$config_file"
125
+ fi
126
+ fi
127
+ fi
128
+ done
129
+
130
+ echo ""
131
+ echo "Please source your shell configuration to apply the changes."
132
+ echo "Example: source ~/.bashrc"
133
+ echo "Example: source ~/.zshrc"
134
+ echo "Example: source ~/.config/fish/config.fish"
135
+ echo ""
@@ -12,7 +12,7 @@ cat <<EOF > $HOME/.config/pip/pip.conf
12
12
  [global]
13
13
  extra-index-url = https://oauth2accesstoken:$TOKEN@us-python.pkg.dev/leverege-registry/leverege-python-packages/simple/
14
14
  EOF
15
- echo "Updated $HOME/.config/pip/pip.conf"
15
+ echo "Updated ~/.config/pip/pip.conf"
16
16
 
17
17
  # Write to pypirc
18
18
  cat <<EOF > $HOME/.pypirc
@@ -25,8 +25,57 @@ repository: https://us-python.pkg.dev/leverege-registry/leverege-python-packages
25
25
  username: oauth2accesstoken
26
26
  password: $TOKEN
27
27
  EOF
28
- echo "Updated $HOME/.pypirc"
28
+ echo "Updated ~/.pypirc"
29
29
 
30
- # Set UV_EXTRA_INDEX_URL env var
31
- export UV_EXTRA_INDEX_URL="https://oauth2accesstoken:$TOKEN@us-python.pkg.dev/leverege-registry/leverege-python-packages/simple"
32
- echo "Updated UV_EXTRA_INDEX_URL"
30
+ escape_for_sed() {
31
+ printf '%s\n' "$1" | sed -e 's/[\/&]/\\&/g'
32
+ }
33
+
34
+ UV_EXTRA_INDEX_URL="https://oauth2accesstoken:$TOKEN@us-python.pkg.dev/leverege-registry/leverege-python-packages/simple"
35
+ UV_EXTRA_INDEX_URL_E=$(escape_for_sed "$UV_EXTRA_INDEX_URL")
36
+
37
+ # List of shell configuration files to update
38
+ SHELLS=("bash" "zsh" "fish")
39
+
40
+ for SHELL in "${SHELLS[@]}"; do
41
+ if command -v "$SHELL" >/dev/null 2>&1; then
42
+ case "$SHELL" in
43
+ bash)
44
+ config_file="${HOME}/.bashrc"
45
+ ;;
46
+ zsh)
47
+ config_file="${HOME}/.zshrc"
48
+ ;;
49
+ fish)
50
+ config_file="${HOME}/.config/fish/config.fish"
51
+ ;;
52
+ *)
53
+ echo "Shell $SHELL is not supported."
54
+ continue
55
+ ;;
56
+ esac
57
+
58
+ echo "Updating shell configuration in $config_file"
59
+
60
+ if grep -q "UV_EXTRA_INDEX_URL" "$config_file"; then
61
+ if [ "$SHELL" = "fish" ]; then
62
+ sed -i '' "s|set -x UV_EXTRA_INDEX_URL .*|set -x UV_EXTRA_INDEX_URL $UV_EXTRA_INDEX_URL_E|" "$config_file"
63
+ else
64
+ sed -i '' "s|export UV_EXTRA_INDEX_URL=.*|export UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL_E|" "$config_file"
65
+ fi
66
+ else
67
+ if [ "$SHELL" = "fish" ]; then
68
+ echo "set -x UV_EXTRA_INDEX_URL $UV_EXTRA_INDEX_URL" >> "$config_file"
69
+ else
70
+ echo "export UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL" >> "$config_file"
71
+ fi
72
+ fi
73
+ fi
74
+ done
75
+
76
+ echo ""
77
+ echo "Please source your shell configuration to apply the changes."
78
+ echo "Example: source ~/.bashrc"
79
+ echo "Example: source ~/.zshrc"
80
+ echo "Example: source ~/.config/fish/config.fish"
81
+ echo ""