Skip to content

Commit 40c176a

Browse files
committed
Install: Regenerate shell scripts
1 parent a70f262 commit 40c176a

11 files changed

Lines changed: 22 additions & 41 deletions

mhkit/package/shell_script_templates/step2_install_conda.ps1.j2

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ function Install-Conda {
4040
Write-Output "CONDA_PATH=$condaPath"
4141
}
4242

43-
# Main execution
4443
function Main {
4544
Write-Info "Step 2: Installing miniconda..."
4645
Install-Conda
4746
}
4847

49-
# Run main function
50-
Main
48+
Main

mhkit/package/shell_scripts/step1_detect_conda.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,9 @@ function Find-Conda {
144144
Write-Output "CONDA_DETECTED=false"
145145
}
146146

147-
# Main execution
148147
function Main {
149148
Write-Info "Step 1: Detecting conda installation..."
150149
Find-Conda
151150
}
152151

153-
# Run main function
154-
Main
152+
Main

mhkit/package/shell_scripts/step1_detect_conda.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,9 @@ detect_conda() {
159159
return 1
160160
}
161161

162-
# Main execution
163162
main() {
164163
log_info "Step 1: Detecting conda installation..."
165164
detect_conda
166165
}
167166

168-
# Run main function
169-
main "$@"
167+
main "$@"

mhkit/package/shell_scripts/step2_install_conda.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,9 @@ function Install-Conda {
100100
Write-Output "CONDA_PATH=$condaPath"
101101
}
102102

103-
# Main execution
104103
function Main {
105104
Write-Info "Step 2: Installing miniconda..."
106105
Install-Conda
107106
}
108107

109-
# Run main function
110-
Main
108+
Main

mhkit/package/shell_scripts/step2_install_conda.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,9 @@ install_conda() {
114114
echo "CONDA_PATH=$HOME/miniconda3/bin/conda"
115115
}
116116

117-
# Main execution
118117
main() {
119118
log_info "Step 2: Installing miniconda..."
120119
install_conda
121120
}
122121

123-
# Run main function
124-
main "$@"
122+
main "$@"

mhkit/package/shell_scripts/step3_create_env.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ function Test-PythonVersion {
129129
}
130130
}
131131

132-
# Main execution
133132
function Main {
134133
param([string]$CondaPath)
135134

@@ -149,9 +148,9 @@ function Main {
149148
Write-Info "Recreating environment with correct Python version..."
150149
& "$CondaPath" remove -n $CONDA_ENV_NAME --all -y 2>$null
151150
New-CondaEnv $CondaPath
152-
Test-PythonVersion $CondaPath # This should succeed now
151+
Test-PythonVersion $CondaPath
153152
}
154153
}
155154

156155
# Run main function with arguments
157-
Main $args[0]
156+
Main $args[0]

mhkit/package/shell_scripts/step3_create_env.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ verify_python_version() {
128128
fi
129129
}
130130

131-
# Main execution
132131
main() {
133132
local conda_path="$1"
134133
if [[ -z "$conda_path" ]]; then
@@ -151,9 +150,8 @@ main() {
151150
log_info "Recreating environment with correct Python version..."
152151
"$conda_path" remove -n "$CONDA_ENV_NAME" --all -y >/dev/null 2>&1 || true
153152
create_conda_env "$conda_path"
154-
verify_python_version "$conda_path" # This should succeed now
153+
verify_python_version "$conda_path"
155154
fi
156155
}
157156

158-
# Run main function
159-
main "$@"
157+
main "$@"

mhkit/package/shell_scripts/step4_install_dependencies.ps1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ function Install-PreDependencies {
6767

6868
Write-Info "Installing pre-install dependencies..."
6969

70-
Write-Info "Executing: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf netcdf4 gfortran pandas numpy -y"
70+
Write-Info "Executing: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf netcdf4 pandas numpy -c conda-forge -y"
7171
try {
72-
conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf netcdf4 gfortran pandas numpy -y
72+
conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf netcdf4 pandas numpy -c conda-forge -y
7373
} catch {
74-
Write-Error "Failed to execute: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf netcdf4 gfortran pandas numpy -y"
74+
Write-Error "Failed to execute: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf netcdf4 pandas numpy -c conda-forge -y"
7575
Write-Output "PRE_DEPS_INSTALLED=false"
7676
exit 1
7777
}
@@ -196,7 +196,6 @@ function Install-MhkitPythonUtils {
196196
}
197197
}
198198

199-
# Main execution
200199
function Main {
201200
param([string]$CondaPath)
202201

@@ -218,4 +217,4 @@ function Main {
218217
}
219218

220219
# Run main function with arguments
221-
Main $args[0]
220+
Main $args[0]

mhkit/package/shell_scripts/step4_install_dependencies.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@ install_pre_dependencies() {
7676
export PATH="$conda_dir:$PATH"
7777

7878
if [[ "$OS_TYPE" == "Darwin" ]]; then
79-
log_info "Executing: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 gfortran pandas numpy -y"
80-
conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 gfortran pandas numpy -y
79+
log_info "Executing: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 pandas numpy -c conda-forge -y"
80+
conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 pandas numpy -c conda-forge -y
8181
if [ $? -ne 0 ]; then
82-
log_error "Failed to execute: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 gfortran pandas numpy -y"
82+
log_error "Failed to execute: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 pandas numpy -c conda-forge -y"
8383
echo "PRE_DEPS_INSTALLED=false"
8484
exit 1
8585
fi
8686
else
87-
log_info "Executing: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 gfortran pandas numpy -y"
88-
conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 gfortran pandas numpy -y
87+
log_info "Executing: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 pandas numpy -c conda-forge -y"
88+
conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 pandas numpy -c conda-forge -y
8989
if [ $? -ne 0 ]; then
90-
log_error "Failed to execute: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 gfortran pandas numpy -y"
90+
log_error "Failed to execute: conda run -n mhkit-matlab-env conda install pip hdf5 libnetcdf cftime netcdf4 pandas numpy -c conda-forge -y"
9191
echo "PRE_DEPS_INSTALLED=false"
9292
exit 1
9393
fi
@@ -213,7 +213,6 @@ install_mhkit_python_utils() {
213213
fi
214214
}
215215

216-
# Main execution
217216
main() {
218217
local conda_path="$1"
219218
if [[ -z "$conda_path" ]]; then
@@ -233,5 +232,4 @@ main() {
233232
install_mhkit_python_utils "$conda_path"
234233
}
235234

236-
# Run main function
237-
main "$@"
235+
main "$@"

mhkit/package/shell_scripts/step5_post_install.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ function Get-PythonPath {
125125
}
126126
}
127127

128-
# Main execution
129128
function Main {
130129
param([string]$CondaPath)
131130

@@ -145,4 +144,4 @@ function Main {
145144
}
146145

147146
# Run main function with arguments
148-
Main $args[0]
147+
Main $args[0]

0 commit comments

Comments
 (0)