mirror of
https://github.com/veeso/termscp.git
synced 2026-07-17 21:34:09 +02:00
feat(install): add Windows PowerShell installer and copy buttons on site
Add install.ps1 mirroring install.sh for Windows: arch detection, release zip download, binary extraction, user PATH update. - copy install.ps1 to site public/ at build time (copy-install.mjs) - serve /install.ps1 with text/plain Content-Type (vercel.json) - add PowerShell one-liner to install page and README - bump install.ps1 default version in bump_version.sh - add CopyButton component next to every install command line
This commit is contained in:
@@ -3,16 +3,24 @@ import { dirname, join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const here = dirname(fileURLToPath(import.meta.url));
|
||||
const src = join(here, '..', '..', 'install.sh'); // repo-root install.sh (single source of truth)
|
||||
const dest = join(here, '..', 'public', 'install.sh');
|
||||
|
||||
try {
|
||||
await access(src);
|
||||
} catch {
|
||||
console.error(`[copy-install] source not found: ${src}`);
|
||||
console.error('[copy-install] the repo-root install.sh must be available at build time.');
|
||||
process.exit(1);
|
||||
}
|
||||
// repo-root install scripts (single source of truth)
|
||||
const scripts = ['install.sh', 'install.ps1'];
|
||||
|
||||
await copyFile(src, dest);
|
||||
console.log('[copy-install] copied install.sh -> public/install.sh');
|
||||
await Promise.all(
|
||||
scripts.map(async (name) => {
|
||||
const src = join(here, '..', '..', name);
|
||||
const dest = join(here, '..', 'public', name);
|
||||
|
||||
try {
|
||||
await access(src);
|
||||
} catch {
|
||||
console.error(`[copy-install] source not found: ${src}`);
|
||||
console.error(`[copy-install] the repo-root ${name} must be available at build time.`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
await copyFile(src, dest);
|
||||
console.log(`[copy-install] copied ${name} -> public/${name}`);
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user