File get-vue.sh of Package PersistenceOS
#!/bin/bash
set -e
# Path to save Vue.js
WEBUI_DIR="/usr/lib/persistence/web-ui"
JS_DIR="${WEBUI_DIR}/js"
VUE_FILE="${JS_DIR}/vue.global.prod.js"
# Make sure the directory exists
mkdir -p "${JS_DIR}"
echo "Downloading Vue.js production build..."
curl -s https://unpkg.com/vue@3/dist/vue.global.prod.js -o "${VUE_FILE}"
if [ -f "${VUE_FILE}" ]; then
echo "Vue.js downloaded successfully to ${VUE_FILE}"
# Set proper permissions
chmod 644 "${VUE_FILE}"
else
echo "Error: Failed to download Vue.js"
exit 1
fi
# Create components directory if it doesn't exist
COMPONENTS_DIR="${JS_DIR}/components"
mkdir -p "${COMPONENTS_DIR}"
echo "Created components directory at ${COMPONENTS_DIR}"
# Set permissions
chmod -R 755 "${JS_DIR}"
find "${JS_DIR}" -type f -exec chmod 644 {} \;
echo "Vue.js setup completed successfully"