Skip to content

Commit

Permalink
fix the symbolic link issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mgold1234 committed Sep 23, 2024
1 parent a91034d commit 8201ab3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
18 changes: 18 additions & 0 deletions create_symlink.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

TARGET_LINK_NAME=image-builder-frontend
LINK_SOURCE="$(pwd)/cockpit/public"

# List of potential directories
DIRECTORIES=(~/.local/share/cockpit/ /usr/local/share/cockpit/ /usr/share/cockpit/)

# Loop through the directories and create the link in the first one that exists
for DIR in "${DIRECTORIES[@]}"; do
if [ -d "$DIR" ]; then
ln -s "$LINK_SOURCE" "$DIR$TARGET_LINK_NAME"
echo "Symbolic link created at $DIR$TARGET_LINK_NAME"
exit 0
fi
done

echo "No suitable directory found for the symbolic link."
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@
"test:watch": "TZ=UTC vitest",
"test:coverage": "TZ=UTC vitest run --coverage",
"build": "fec build",
"cockpit:build": "webpack --config cockpit/webpack.config.ts && npm run cockpit:buildln",
"cockpit:buildln": "ln -s $(pwd)/cockpit/public ~/.local/share/cockpit/image-builder-frontend",
"cockpit:build": "webpack --config cockpit/webpack.config.ts && ./create_symlink.sh",
"api": "npm-run-all api:pull api:generate",
"api:generate": "bash api/codegen.sh",
"api:pull": "bash api/pull.sh",
Expand Down

0 comments on commit 8201ab3

Please sign in to comment.