Windows server packaging

Summary: ^

Reviewed By: passy

Differential Revision: D47833317

fbshipit-source-id: b500f58b4ef0e201d8a711f3a83774fa82a7199b
This commit is contained in:
Lorenzo Blasa
2023-07-27 07:58:22 -07:00
committed by Facebook GitHub Bot
parent 566125af3f
commit dc0fd0a9e7

View File

@@ -55,6 +55,13 @@ cd "$THIS_DIR"
./node ./server "$@"
`;
const WINDOWS_STARTUP_SCRIPT = `@echo off
setlocal
set "THIS_DIR=%~dp0"
cd /d "%THIS_DIR%"
node server %*
`;
const argv = yargs
.usage('yarn build-flipper-server [args]')
.version(false)
@@ -618,6 +625,12 @@ async function setUpLinuxBundle(outputDir: string) {
async function setUpWindowsBundle(outputDir: string) {
console.log(`⚙️ Creating Windows bundle in ${outputDir}`);
await fs.writeFile(
path.join(outputDir, 'flipper.bat'),
WINDOWS_STARTUP_SCRIPT,
);
// Give the script +x
await fs.chmod(path.join(outputDir, 'flipper.bat'), 0o755);
}
async function setUpMacBundle(