We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d23b2dc commit 08ec2c1Copy full SHA for 08ec2c1
template/.devcontainer/checkREnvironment.sh.jinja
@@ -35,13 +35,11 @@ fi
35
echo "✅ pak is installed"
36
37
# Check if renv.lock exists and restore if needed
38
-if [[ -f "../renv.lock" ]]; then
+PROJECT_ROOT="$(dirname "$(dirname "$(realpath "$0")")")"
39
+if [[ -f "$PROJECT_ROOT/renv.lock" ]]; then
40
echo "📦 Found renv.lock file, restoring environment..."
41
- # Change to project root directory for renv operations
42
- cd ..
43
-
44
- if Rscript -e "renv::restore()"; then
+ if Rscript -e "setwd('$PROJECT_ROOT'); renv::restore()"; then
45
echo "✅ R environment restored successfully"
46
else
47
echo "❌ Error: Failed to restore R environment from renv.lock"
0 commit comments