Skip to content

Commit

Permalink
Merge pull request #17 from tkhtechnology/MX002-8368_clean
Browse files Browse the repository at this point in the history
chore: Mitigate production vulnerabilities
  • Loading branch information
StorytellerCZ authored May 7, 2023
2 parents 6f1390b + 7c64e3e commit 038dbb3
Show file tree
Hide file tree
Showing 9 changed files with 1,718 additions and 1,115 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- checkout
- run:
name: Update npm
command: 'sudo npm install -g npm@latest'
command: 'sudo npm install -g npm@6'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
- run:
Expand Down
21 changes: 10 additions & 11 deletions lib/electronApp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// eslint-disable-next-line no-unused-vars
import regeneratorRuntime from 'regenerator-runtime/runtime';
import asar from 'asar';
import asar from '@electron/asar';
import assignIn from 'lodash/assignIn';
import _ from 'lodash';
import { LocalInstaller, progress } from 'install-local';
Expand Down Expand Up @@ -70,8 +70,9 @@ export default class ElectronApp {
this.log.debug('packing');
asar.createPackage(
this.$.env.paths.electronApp.appRoot,
this.$.env.paths.electronApp.appAsar,
() => {
this.$.env.paths.electronApp.appAsar
)
.then(() => {
// Lets move the node_modules back.
this.log.debug('moving node_modules back from app dir');

Expand Down Expand Up @@ -116,8 +117,7 @@ export default class ElectronApp {
{ force: true }
);
resolve();
}
);
});
});
}

Expand Down Expand Up @@ -621,8 +621,7 @@ export default class ElectronApp {
undefined,
this.$.env.paths.electronApp.root
)
)
);
));
}
}
await Promise.all(promises);
Expand Down Expand Up @@ -812,8 +811,9 @@ export default class ElectronApp {
return new Promise((resolve, reject) => {
asar.createPackage(
this.$.env.paths.desktopTmp.root,
this.$.env.paths.electronApp.desktopAsar,
() => {
this.$.env.paths.electronApp.desktopAsar
)
.then(() => {
this.log.verbose('clearing temporary .desktop');
this.$.utils
.rmWithRetries('-rf', this.$.env.paths.desktopTmp.root)
Expand All @@ -824,8 +824,7 @@ export default class ElectronApp {
reject(e);
});
resolve();
}
);
});
});
}

Expand Down
10 changes: 5 additions & 5 deletions lib/meteorApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import semver from 'semver';
import shell from 'shelljs';
import path from 'path';
import singleLineLog from 'single-line-log';
import asar from 'asar';
import asar from '@electron/asar';
import fetch from 'node-fetch';

import IsDesktopInjector from '../skeleton/modules/autoupdate/isDesktopInjector';
Expand Down Expand Up @@ -892,8 +892,9 @@ export default class MeteorApp {
return new Promise((resolve, reject) =>
asar.createPackage(
this.$.env.paths.electronApp.meteorApp,
path.join(this.$.env.paths.electronApp.root, 'meteor.asar'),
() => {
path.join(this.$.env.paths.electronApp.root, 'meteor.asar')
)
.then(() => {
// On Windows some files might still be blocked. Giving a tick for them to be
// ready for deletion.
setImmediate(() => {
Expand All @@ -907,8 +908,7 @@ export default class MeteorApp {
reject(e);
});
});
}
));
}));
}

/**
Expand Down
Loading

0 comments on commit 038dbb3

Please sign in to comment.