mirror of
https://github.com/unraid/api.git
synced 2026-05-08 08:00:19 -05:00
f7ad582436
- Removed redundant modal div from `test-standalone.html`, simplifying the structure for Vue component mounting. - Added a check in `add-timestamp-standalone-manifest.js` to ensure the existence of the standalone apps directory before manifest generation, improving error handling. - Updated `deploy-dev.sh` to enhance the rsync command for standalone apps, ensuring proper synchronization and cleanup of old files during deployment.
36 lines
853 B
JavaScript
36 lines
853 B
JavaScript
#!/usr/bin/env node
|
|
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
const distPath = '.nuxt/standalone-apps';
|
|
const manifestPath = path.join(distPath, 'standalone.manifest.json');
|
|
|
|
// Check if directory exists
|
|
if (!fs.existsSync(distPath)) {
|
|
console.warn(`Directory ${distPath} does not exist. Skipping manifest generation.`);
|
|
process.exit(0);
|
|
}
|
|
|
|
// Get all JS files in the dist directory
|
|
const files = fs.readdirSync(distPath);
|
|
const manifest = {};
|
|
|
|
files.forEach(file => {
|
|
if (file.endsWith('.js') || file.endsWith('.css')) {
|
|
const key = file.replace(/\.(js|css)$/, '.$1');
|
|
manifest[key] = {
|
|
file: file,
|
|
src: file,
|
|
};
|
|
}
|
|
});
|
|
|
|
// Add timestamp
|
|
manifest.ts = Date.now();
|
|
|
|
// Write manifest
|
|
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
|
|
|
|
console.log('Standalone apps manifest created:', manifestPath);
|