Spaces:
Paused
Paused
Update init.sh
Browse files
init.sh
CHANGED
|
@@ -21,7 +21,7 @@ if [ -n "$GITHUB_PAT" ]; then
|
|
| 21 |
echo "π Latest Git Commit:"
|
| 22 |
|
| 23 |
git log -1 --pretty=format:"πΉ %h πΉ %s πΉ by %an πΉ on %ad" --date=short πΉ
|
| 24 |
-
echo
|
| 25 |
|
| 26 |
echo "π Moving contents from $TARGET_DIR to $APP_DIR..."
|
| 27 |
shopt -s dotglob # include hidden files like .env, .gitignore
|
|
@@ -35,8 +35,22 @@ if [ -n "$GITHUB_PAT" ]; then
|
|
| 35 |
# chmod -R 777 "$APP_DIR/*"
|
| 36 |
ls -la "$APP_DIR"
|
| 37 |
echo "π§ Setting up sessions & permissions..."
|
| 38 |
-
|
| 39 |
-
chmod -R 777 "$APP_DIR/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
else
|
| 41 |
echo "β
Repository already cloned at $TARGET_DIR"
|
| 42 |
fi
|
|
|
|
| 21 |
echo "π Latest Git Commit:"
|
| 22 |
|
| 23 |
git log -1 --pretty=format:"πΉ %h πΉ %s πΉ by %an πΉ on %ad" --date=short πΉ
|
| 24 |
+
echo
|
| 25 |
|
| 26 |
echo "π Moving contents from $TARGET_DIR to $APP_DIR..."
|
| 27 |
shopt -s dotglob # include hidden files like .env, .gitignore
|
|
|
|
| 35 |
# chmod -R 777 "$APP_DIR/*"
|
| 36 |
ls -la "$APP_DIR"
|
| 37 |
echo "π§ Setting up sessions & permissions..."
|
| 38 |
+
SESSION_DIR="$APP_DIR/sessions"
|
| 39 |
+
chmod -R 777 "$APP_DIR/sessions"
|
| 40 |
+
|
| 41 |
+
echo "π Scanning files in: $SESSION_DIR"
|
| 42 |
+
echo
|
| 43 |
+
|
| 44 |
+
find "$SESSION_DIR" -type f | while read -r file; do
|
| 45 |
+
perms=$(stat -c "%A" "$file") # Get permission string
|
| 46 |
+
if [ -w "$file" ]; then
|
| 47 |
+
writable="β
Writable"
|
| 48 |
+
else
|
| 49 |
+
writable="β Not Writable"
|
| 50 |
+
fi
|
| 51 |
+
echo "$perms $writable β $file"
|
| 52 |
+
done
|
| 53 |
+
|
| 54 |
else
|
| 55 |
echo "β
Repository already cloned at $TARGET_DIR"
|
| 56 |
fi
|