File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " Azure Artifacts Credential Helper" ,
33 "id" : " artifacts-helper" ,
4- "version" : " 3.0.7 " ,
4+ "version" : " 3.0.8 " ,
55 "description" : " Configures Codespace to authenticate with Azure Artifact feeds" ,
66 "options" : {
77 "nugetURIPrefixes" : {
Original file line number Diff line number Diff line change @@ -131,14 +131,19 @@ for ALIAS in "${ALIASES_ARR[@]}"; do
131131 ALIASES_BLOCK+=" $ALIAS () { \" ${SHIM_DIRECTORY} /$ALIAS \" \"\$ @\" ; }" $' \n '
132132done
133133
134+ _TEMP_BLOCK=$( mktemp)
135+ printf ' %s' " $ALIASES_BLOCK " > " $_TEMP_BLOCK "
136+
134137for TARGET_FILE in " ${TARGET_FILES_ARR[@]} " ; do
135138 if [ " ${INSTALL_WITH_SUDO} " = " true" ]; then
136- sudo -u ${_REMOTE_USER} bash -c " printf '%s' \" $ALIASES_BLOCK \" >> $TARGET_FILE "
139+ sudo -u " ${_REMOTE_USER} " bash -c " cat ' $_TEMP_BLOCK ' >> $TARGET_FILE "
137140 else
138- printf ' %s ' " $ALIASES_BLOCK " >> " $TARGET_FILE " || true
141+ cat " $_TEMP_BLOCK " >> " $TARGET_FILE " || true
139142 fi
140143done
141144
145+ rm -f " $_TEMP_BLOCK "
146+
142147if [ " ${INSTALL_WITH_SUDO} " = " true" ]; then
143148 sudo -u ${_REMOTE_USER} bash -c " /tmp/install-provider.sh ${USENET6} "
144149fi
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ check "npm shell function written to bash.bashrc" grep -q "npm()" /etc/bash.bash
2929check " dotnet shell function written to bash.bashrc" grep -q " dotnet()" /etc/bash.bashrc
3030check " npm shell function on its own line in bash.bashrc" grep -q " ^npm()" /etc/bash.bashrc
3131
32+ # Verify aliases include proper quoting and argument passing ($@)
33+ check " dotnet alias has quoted path and passes args" grep -q ' dotnet() { ".*/dotnet" "\$@"; }' /etc/bash.bashrc
34+ check " npm alias has quoted path and passes args" grep -q ' npm() { ".*/npm" "\$@"; }' /etc/bash.bashrc
35+
3236# Verify newlines between shim definitions (each function should be on its own line)
3337check " each shim function is on its own line" bash -c '
3438 # Count function definitions at line starts - with proper newlines each will start at column 0
You can’t perform that action at this time.
0 commit comments