mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
49 lines
1.1 KiB
JavaScript
Executable File
49 lines
1.1 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
var JawsError = require('../lib/jaws-error'),
|
|
JAWS = require('../lib/index.js'),
|
|
program = require('commander'),
|
|
handleExit = require('../lib/utils').handleExit;
|
|
|
|
program
|
|
.version(JAWS._meta.version);
|
|
|
|
//TODO: need to provide cli options/env vars to bypass input
|
|
program
|
|
.command('new')
|
|
.description('Create a new JAWS project in the current working directory')
|
|
.action(function() {
|
|
handleExit(JAWS.new());
|
|
});
|
|
|
|
program
|
|
.command('install <url>')
|
|
.description('Installs an jaws-module')
|
|
.action(function(url) {
|
|
handleExit(JAWS.install(url));
|
|
});
|
|
|
|
program
|
|
.command('tag')
|
|
.description('Tag a lambda function to be deployed')
|
|
.action(function() {
|
|
handleExit(JAWS.tag());
|
|
});
|
|
|
|
program
|
|
.command('logs <stage>')
|
|
.description('Get logs for a lambda function, or all lambda functions in a stage.')
|
|
.action(function(stage) {
|
|
handleExit(JAWS.logs(stage));
|
|
});
|
|
|
|
program
|
|
.command('*')
|
|
.action(function() {
|
|
handleExit(JAWS.custom(arguments));
|
|
});
|
|
|
|
program.parse(process.argv);
|