Skip to content

Commit 40287f2

Browse files
committed
remove symlinks and update scripts with paths relative to its own folder instead of cwd
1 parent 625866f commit 40287f2

18 files changed

+75
-39
lines changed

aca-host/app

Lines changed: 0 additions & 1 deletion
This file was deleted.

aca-host/azure.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,22 @@ hooks:
9797
preprovision:
9898
windows:
9999
shell: pwsh
100-
run: ./scripts/auth_init.ps1
100+
run: ../scripts/auth_init.ps1
101101
interactive: true
102102
continueOnError: false
103103
posix:
104104
shell: sh
105-
run: ./scripts/auth_init.sh
105+
run: ../scripts/auth_init.sh
106106
interactive: true
107107
continueOnError: false
108108
postprovision:
109109
windows:
110110
shell: pwsh
111-
run: ./scripts/auth_update.ps1;./scripts/prepdocs.ps1
111+
run: ../scripts/auth_update.ps1; ../scripts/prepdocs.ps1
112112
interactive: true
113113
continueOnError: false
114114
posix:
115115
shell: sh
116-
run: ./scripts/auth_update.sh;./scripts/prepdocs.sh
116+
run: ../scripts/auth_update.sh; ../scripts/prepdocs.sh
117117
interactive: true
118118
continueOnError: false

aca-host/data

Lines changed: 0 additions & 1 deletion
This file was deleted.

aca-host/scripts

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/adlsgen2setup.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Set the preference to stop on the first error
22
$ErrorActionPreference = "Stop"
33

4+
$projectRoot = Split-Path -Parent $PSScriptRoot
45
& $PSScriptRoot\loadenv.ps1
56

67
$venvPythonPath = "./.venv/scripts/python.exe"
@@ -15,5 +16,4 @@ if ([string]::IsNullOrEmpty($env:AZURE_ADLS_GEN2_STORAGE_ACCOUNT)) {
1516
}
1617

1718
Write-Host 'Running "adlsgen2setup.py"'
18-
$cwd = (Get-Location)
19-
Start-Process -FilePath $venvPythonPath -ArgumentList "./scripts/adlsgen2setup.py `"$cwd/data`" --data-access-control ./scripts/sampleacls.json --storage-account $env:AZURE_ADLS_GEN2_STORAGE_ACCOUNT -v" -Wait -NoNewWindow
19+
Start-Process -FilePath $venvPythonPath -ArgumentList "$projectRoot/scripts/adlsgen2setup.py `"$projectRoot/data`" --data-access-control $projectRoot/scripts/sampleacls.json --storage-account $env:AZURE_ADLS_GEN2_STORAGE_ACCOUNT -v" -Wait -NoNewWindow

scripts/adlsgen2setup.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/sh
22

3-
. ./scripts/loadenv.sh
3+
# Get the project root of the current script
4+
project_root="$(cd "$(dirname $(dirname $0))" && pwd)"
5+
script_dir="$project_root/scripts"
6+
data_dir="$project_root/data"
7+
8+
. $script_dir/loadenv.sh
49

510
if [ -n "$AZURE_ADLS_GEN2_STORAGE_ACCOUNT" ]; then
611
echo 'AZURE_ADLS_GEN2_STORAGE_ACCOUNT must be set to continue'
@@ -9,4 +14,4 @@ fi
914

1015
echo 'Running "adlsgen2setup.py"'
1116

12-
./.venv/bin/python ./scripts/adlsgen2setup.py './data/*' --data-access-control './scripts/sampleacls.json' --storage-account "$AZURE_ADLS_GEN2_STORAGE_ACCOUNT" -v
17+
./.venv/bin/python $script_dir/adlsgen2setup.py "$data_dir/*" --data-access-control "$script_dir/sampleacls.json" --storage-account "$AZURE_ADLS_GEN2_STORAGE_ACCOUNT" -v

scripts/auth_init.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
. ./scripts/load_azd_env.ps1
1+
$projectRoot = Split-Path -Parent $PSScriptRoot
2+
. $projectRoot/scripts/load_azd_env.ps1
23

34
if (-not $env:AZURE_USE_AUTHENTICATION) {
45
Exit 0
56
}
67

7-
. ./scripts/load_python_env.ps1
8+
. $projectRoot/scripts/load_python_env.ps1
89

910
$venvPythonPath = "./.venv/scripts/python.exe"
1011
if (Test-Path -Path "/usr") {
1112
# fallback to Linux venv path
1213
$venvPythonPath = "./.venv/bin/python"
1314
}
1415

15-
Start-Process -FilePath $venvPythonPath -ArgumentList "./scripts/auth_init.py" -Wait -NoNewWindow
16+
Start-Process -FilePath $venvPythonPath -ArgumentList "$projectRoot/scripts/auth_init.py" -Wait -NoNewWindow

scripts/auth_init.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
#!/bin/sh
22

3+
# Get the project root of the current script
4+
project_root="$(cd "$(dirname $(dirname $0))" && pwd)"
5+
script_dir="$project_root/scripts"
6+
data_dir="$project_root/data"
7+
38
echo "Checking if authentication should be setup..."
49

5-
. ./scripts/load_azd_env.sh
10+
. $script_dir/load_azd_env.sh
611

712
if [ -z "$AZURE_USE_AUTHENTICATION" ]; then
813
echo "AZURE_USE_AUTHENTICATION is not set, skipping authentication setup."
@@ -11,6 +16,6 @@ fi
1116

1217
echo "AZURE_USE_AUTHENTICATION is set, proceeding with authentication setup..."
1318

14-
. ./scripts/load_python_env.sh
19+
. $script_dir/load_python_env.sh
1520

16-
./.venv/bin/python ./scripts/auth_init.py
21+
./.venv/bin/python $script_dir/auth_init.py

scripts/auth_update.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
. ./scripts/load_azd_env.ps1
1+
$projectRoot = Split-Path -Parent $PSScriptRoot
2+
. $projectRoot/scripts/load_azd_env.ps1
23

34
if (-not $env:AZURE_USE_AUTHENTICATION) {
45
Exit 0
56
}
67

7-
. ./scripts/load_python_env.ps1
8+
. $projectRoot/scripts/load_python_env.ps1
89

910
$venvPythonPath = "./.venv/scripts/python.exe"
1011
if (Test-Path -Path "/usr") {
1112
# fallback to Linux venv path
1213
$venvPythonPath = "./.venv/bin/python"
1314
}
1415

15-
Start-Process -FilePath $venvPythonPath -ArgumentList "./scripts/auth_update.py" -Wait -NoNewWindow
16+
Start-Process -FilePath $venvPythonPath -ArgumentList "$projectRoot/scripts/auth_update.py" -Wait -NoNewWindow

scripts/auth_update.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
#!/bin/sh
22

3-
. ./scripts/load_azd_env.sh
3+
# Get the project root of the current script
4+
project_root="$(cd "$(dirname $(dirname $0))" && pwd)"
5+
script_dir="$project_root/scripts"
6+
7+
. $script_dir/load_azd_env.sh
48

59
if [ -z "$AZURE_USE_AUTHENTICATION" ]; then
610
exit 0
711
fi
812

9-
. ./scripts/load_python_env.sh
13+
. $script_dir/load_python_env.sh
1014

11-
./.venv/bin/python ./scripts/auth_update.py
15+
./.venv/bin/python $script_dir/auth_update.py

0 commit comments

Comments
 (0)