Skip to content

Commit 988fd0f

Browse files
authored
Update init.sh
1 parent 240ce4e commit 988fd0f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

init.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,22 @@ CLONE_DIR="/home/onyxia/work/funathon-sujet3"
66
git clone --depth 1 $REPO_URL $CLONE_DIR
77
cd $CLONE_DIR
88

9+
#!/bin/bash
10+
11+
# Check if the first parameter is "R"
12+
if [[ $LANGUAGE == "R" ]]; then
13+
# Define the path to the package list file
14+
package_file="requirements_$LANGUAGE.txt" # Replace with the path to your package list file
15+
16+
# Read the package names from the file and install them
17+
while read -r package; do
18+
Rscript -e "if (!requireNamespace('$package', quietly = TRUE)) install.packages('$package')"
19+
done < "$package_file"
20+
else
21+
pip install -r requirements_"$LANGUAGE".txt
22+
fi
23+
924
# Install required packages
10-
pip install -r requirements_"$LANGUAGE".txt
1125

1226
# Open the relevant notebook when starting Jupyter Lab
1327
jupyter server --generate-config

0 commit comments

Comments
 (0)