mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
fix linting errors
This commit is contained in:
parent
4f95d44059
commit
e50d2fe475
@ -38,10 +38,10 @@ class Install {
|
||||
const repo = {
|
||||
owner: parts[1],
|
||||
repo: parts[2],
|
||||
branch: 'master'
|
||||
branch: 'master',
|
||||
};
|
||||
|
||||
//TODO: Support github tree URLS (branch)
|
||||
// TODO: Support github tree URLS (branch)
|
||||
if (~repo.repo.indexOf('#')) {
|
||||
repo.repo = url[2].split('#')[0];
|
||||
repo.branch = url[2].split('#')[1];
|
||||
@ -53,19 +53,18 @@ class Install {
|
||||
'https://github.com/serverless/serverless');
|
||||
}
|
||||
|
||||
const downloadUrl = 'https://github.com/' + repo.owner + '/' + repo.repo
|
||||
+ '/archive/' + repo.branch + '.zip';
|
||||
const downloadUrl = `https://github.com/${repo.owner}/${repo.repo}/archive/${repo.branch}.zip`;
|
||||
const servicePath = path.join(process.cwd(), repo.repo);
|
||||
|
||||
// Throw error if service path already exists
|
||||
if (this.serverless.utils.dirExistsSync(servicePath)) {
|
||||
throw new this.serverless.classes.Error('A folder named \'' + repo.repo + '\' already exists' +
|
||||
' within the current working directory.');
|
||||
throw new this.serverless.classes.Error(`A folder named \'${repo.repo}\' already exists `
|
||||
+ `within the current working directory.`);
|
||||
}
|
||||
|
||||
// Inform
|
||||
this.serverless.cli.log(`Downloading and installing \'${repo.repo}\'...`);
|
||||
let _this = this;
|
||||
const self = this;
|
||||
|
||||
// Download service
|
||||
return download(
|
||||
@ -77,9 +76,9 @@ class Install {
|
||||
strip: 1,
|
||||
mode: '755',
|
||||
})
|
||||
.then(function() {
|
||||
_this.serverless.cli.log(`Successfully installed \'${repo.repo}\'!`);
|
||||
})
|
||||
.then(() => {
|
||||
self.serverless.cli.log(`Successfully installed \'${repo.repo}\'!`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user