2023-07-06 17:02:19 +00:00
|
|
|
diff --git a/node_modules/oclif/lib/commands/pack/win.js b/node_modules/oclif/lib/commands/pack/win.js
|
2024-03-07 16:43:33 +00:00
|
|
|
index c0926bd..e4f645c 100644
|
2023-07-06 17:02:19 +00:00
|
|
|
--- a/node_modules/oclif/lib/commands/pack/win.js
|
|
|
|
+++ b/node_modules/oclif/lib/commands/pack/win.js
|
2023-09-06 14:39:31 +00:00
|
|
|
@@ -59,6 +59,12 @@ InstallDir "\$PROGRAMFILES${arch === 'x64' ? '64' : ''}\\${config.dirname}"
|
2023-07-06 17:02:19 +00:00
|
|
|
${customization}
|
|
|
|
|
|
|
|
Section "${config.name} CLI \${VERSION}"
|
|
|
|
+ ; First remove any old client files.
|
|
|
|
+ ; (Remnants of old versions were causing CLI errors)
|
|
|
|
+ ; Initially tried running the Uninstall.exe, but was
|
|
|
|
+ ; unable to make script wait for completion (despite using _?)
|
|
|
|
+ DetailPrint "Removing files from previous version."
|
|
|
|
+ RMDir /r "$INSTDIR\\client"
|
|
|
|
SetOutPath $INSTDIR
|
|
|
|
File /r bin
|
|
|
|
File /r client
|
|
|
|
diff --git a/node_modules/oclif/lib/tarballs/build.js b/node_modules/oclif/lib/tarballs/build.js
|
2024-03-11 18:37:34 +00:00
|
|
|
index 384ea4b..4d6593a 100644
|
2023-07-06 17:02:19 +00:00
|
|
|
--- a/node_modules/oclif/lib/tarballs/build.js
|
|
|
|
+++ b/node_modules/oclif/lib/tarballs/build.js
|
2024-03-12 10:42:07 +00:00
|
|
|
@@ -30,7 +30,9 @@ async function build(c, options = {}) {
|
2023-07-06 17:02:19 +00:00
|
|
|
await fs.emptyDir(c.workspace());
|
|
|
|
const tarballNewLocation = path.join(c.workspace(), path.basename(tarball));
|
|
|
|
await fs.move(tarball, tarballNewLocation);
|
|
|
|
- await exec(`tar -xzf "${tarballNewLocation}"`, { cwd: c.workspace() });
|
2024-03-07 16:43:33 +00:00
|
|
|
+ let tarCmd = `tar -xzf "${tarballNewLocation}"`;
|
|
|
|
+ if (process.platform === 'win32') tarCmd += ' --force-local';
|
|
|
|
+ await exec(tarCmd, { cwd: c.workspace() });
|
2023-07-06 17:02:19 +00:00
|
|
|
await Promise.all((await fs.promises.readdir(path.join(c.workspace(), 'package'), { withFileTypes: true }))
|
|
|
|
.map(i => fs.move(path.join(c.workspace(), 'package', i.name), path.join(c.workspace(), i.name))));
|
|
|
|
await Promise.all([
|
2024-03-12 10:42:07 +00:00
|
|
|
@@ -38,6 +40,13 @@ async function build(c, options = {}) {
|
2023-07-06 17:02:19 +00:00
|
|
|
fs.promises.rm(path.join(c.workspace(), path.basename(tarball)), { recursive: true }),
|
|
|
|
fs.remove(path.join(c.workspace(), 'bin', 'run.cmd')),
|
|
|
|
]);
|
|
|
|
+ // rename the original balena-cli ./bin/balena entry point for oclif compatibility
|
|
|
|
+ await fs.move(path.join(c.workspace(), 'bin', 'balena'), path.join(c.workspace(), 'bin', 'run'));
|
|
|
|
+ // The oclif installers are a production installation, while the source
|
|
|
|
+ // `bin` folder may contain a `.fast-boot.json` file of a dev installation.
|
|
|
|
+ // This has previously led to issues preventing the CLI from starting, so
|
|
|
|
+ // delete `.fast-boot.json` (if any) from the destination folder.
|
|
|
|
+ await fs.promises.rm(path.join(c.workspace(), 'bin', '.fast-boot.json'));
|
|
|
|
};
|
|
|
|
const updatePJSON = async () => {
|
|
|
|
const pjsonPath = path.join(c.workspace(), 'package.json');
|