git ssb

1+

mixmix / scuttle-shell



Tree: 05758207d7227e06350b4212f502124c6b062e63

Files: 05758207d7227e06350b4212f502124c6b062e63 / scripts / check-configuration.js

1138 bytesRaw
1var fs = require('fs')
2var path = require('path')
3var homedir = require('os').homedir()
4var 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
8function 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
35module.exports = check
36
37if (require.main === module) {
38 var errorLevel = check()
39}
40

Built with git-ssb-web