-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the structure of the application
- Loading branch information
1 parent
6953689
commit 72b485b
Showing
11 changed files
with
43 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const { spawn } = require('child_process'); | ||
|
||
const installDependencies = () => new Promise((resolve, reject) => { | ||
const npm = spawn('npm', ['i']); | ||
npm.on('error', reject); | ||
npm.on('close', resolve); | ||
}); | ||
|
||
const unpackSkypeApplication = () => new Promise((resolve, reject) => { | ||
const npm = spawn('npm', ['run', 'extract']); | ||
npm.stdout.on('error', reject); | ||
npm.stdout.on('close', resolve); | ||
}); | ||
|
||
module.exports = { installDependencies, unpackSkypeApplication }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const fs = require('fs'); | ||
const paths = require('./paths.json'); | ||
|
||
const { | ||
unpackSkypeApplication, | ||
installDependencies | ||
} = require('./helpers'); | ||
|
||
const main = async () => { | ||
const isExist = path => fs.existsSync(path); | ||
const pathToSkype = paths.skype; | ||
|
||
if (isExist(pathToSkype)) { | ||
|
||
console.log('Installing dependencies...'); | ||
await installDependencies(); | ||
console.log('The installation is complete!\n----'); | ||
|
||
console.log('Unpacking skype packages...'); | ||
await unpackSkypeApplication(); | ||
console.log('Unpacking is complete!'); | ||
} else { | ||
throw new Error("'Skype for linux' applicaton does not exist"); | ||
} | ||
} | ||
|
||
main(); |
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes