no version = latest version
This commit is contained in:
parent
589dfec6df
commit
f683dfc2cf
|
@ -3,11 +3,17 @@ const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
|
|
||||||
exports.command = ['execute <language> <language-version> <file> [args..]']
|
exports.command = ['execute <language> <file> [args..]']
|
||||||
exports.aliases = ['run']
|
exports.aliases = ['run']
|
||||||
exports.describe = 'Executes file with the specified runner'
|
exports.describe = 'Executes file with the specified runner'
|
||||||
|
|
||||||
exports.builder = {
|
exports.builder = {
|
||||||
|
languageVersion: {
|
||||||
|
string: true,
|
||||||
|
desc: 'Set the version of the language to use',
|
||||||
|
alias: ['l'],
|
||||||
|
default: '*'
|
||||||
|
},
|
||||||
stdin: {
|
stdin: {
|
||||||
boolean: true,
|
boolean: true,
|
||||||
desc: 'Read input from stdin and pass to executor',
|
desc: 'Read input from stdin and pass to executor',
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
|
|
||||||
exports.command = ['install <language> <language-version>']
|
exports.command = ['install <language> [language-version]']
|
||||||
exports.aliases = ['i']
|
exports.aliases = ['i']
|
||||||
exports.describe = 'Installs the named package'
|
exports.describe = 'Installs the named package'
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ const msg_format = {
|
||||||
|
|
||||||
exports.handler = async function({axios, language, languageVersion}){
|
exports.handler = async function({axios, language, languageVersion}){
|
||||||
try{
|
try{
|
||||||
const install = await axios.post(`/api/v1/packages/${language}/${languageVersion}`)
|
const install = await axios.post(`/api/v1/packages/${language}/${languageVersion || '*'}`)
|
||||||
|
|
||||||
console.log(msg_format.color(install.data));
|
console.log(msg_format.color(install.data));
|
||||||
}catch({response}){
|
}catch({response}){
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
|
|
||||||
exports.command = ['uninstall <language> <language-version>']
|
exports.command = ['uninstall <language> [language-version]']
|
||||||
exports.aliases = ['u']
|
exports.aliases = ['u']
|
||||||
exports.describe = 'Uninstalls the named package'
|
exports.describe = 'Uninstalls the named package'
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ const msg_format = {
|
||||||
|
|
||||||
exports.handler = async function({axios, language, languageVersion}){
|
exports.handler = async function({axios, language, languageVersion}){
|
||||||
try{
|
try{
|
||||||
const uninstall = await axios.delete(`/api/v1/packages/${language}/${languageVersion}`)
|
const uninstall = await axios.delete(`/api/v1/packages/${language}/${languageVersion || '*'}`)
|
||||||
|
|
||||||
console.log(msg_format.color(uninstall.data));
|
console.log(msg_format.color(uninstall.data));
|
||||||
}catch({response}){
|
}catch({response}){
|
||||||
|
|
Loading…
Reference in New Issue