Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Mitigate production vulnerabilities #17

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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