Files: 69094b14d8a0f96b5da1d4ce1008b7ba2ceb94d3 / scripts / check-configuration.js
1138 bytesRaw
1 | var fs = require('fs') |
2 | var path = require('path') |
3 | var homedir = require('os').homedir() |
4 | var manifestPath = process.platform === 'darwin' |
5 | ? path.join(homedir, '/Library/Application Support/Mozilla/NativeMessagingHosts/scuttleshell.json') |
6 | : path.join(homedir, '/.mozilla/native-messaging-hosts/scuttleshell.json') |
7 | |
8 | function check () { |
9 | if (process.platform === 'win32') { |
10 | console.log('This script does not work on windows') |
11 | process.exit(1) |
12 | } |
13 | |
14 | if (!fs.existsSync(manifestPath)) { |
15 | console.log('[ERROR] App manifest not found at declared location', manifestPath) |
16 | console.log('\nTry: npm run setup\n') |
17 | process.exit(1) |
18 | } |
19 | |
20 | console.log('[INFO] App manifest path location:', manifestPath) |
21 | |
22 | var manifest = require(manifestPath) |
23 | |
24 | if (!fs.existsSync(manifest.path)) { |
25 | console.log('[ERROR] Launcher not found at declared location', manifest.path) |
26 | console.log('\nTry: npm run setup\n') |
27 | process.exit(1) |
28 | } |
29 | |
30 | console.log('[OK] Configuration appears correct\n[INFO] App located at:', manifest.path) |
31 | |
32 | process.exit(0) |
33 | } |
34 | |
35 | module.exports = check |
36 | |
37 | if (require.main === module) { |
38 | var errorLevel = check() |
39 | } |
40 |
Built with git-ssb-web