fix cli
This commit is contained in:
parent
543cb11e69
commit
93188099b7
|
@ -8,7 +8,7 @@ exports.aliases = ['run'];
|
|||
exports.describe = 'Executes file with the specified runner';
|
||||
|
||||
exports.builder = {
|
||||
version: {
|
||||
language_version: {
|
||||
string: true,
|
||||
desc: 'Set the version of the language to use',
|
||||
alias: ['l'],
|
||||
|
@ -55,7 +55,7 @@ exports.handler = async (argv) => {
|
|||
|
||||
const request = {
|
||||
language: argv.language,
|
||||
version: argv['language-version'],
|
||||
version: argv['language_version'],
|
||||
files: files,
|
||||
args: argv.args,
|
||||
stdin,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const chalk = require('chalk');
|
||||
|
||||
exports.command = ['install <language> [language-version]'];
|
||||
exports.command = ['install <language> [language_version]'];
|
||||
exports.aliases = ['i'];
|
||||
exports.describe = 'Installs the named package';
|
||||
|
||||
|
@ -10,12 +10,14 @@ const msg_format = {
|
|||
json: JSON.stringify
|
||||
};
|
||||
|
||||
exports.handler = async ({ axios, language, version }) => {
|
||||
exports.handler = async ({ axios, language, language_version }) => {
|
||||
try {
|
||||
const install = await axios.post(`/api/v2/packages`, {
|
||||
const request = {
|
||||
language,
|
||||
version: version || '*'
|
||||
});
|
||||
version: language_version || '*'
|
||||
};
|
||||
|
||||
const install = await axios.post(`/api/v2/packages`, request);
|
||||
|
||||
console.log(msg_format.color(install.data));
|
||||
} catch ({ response }) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const chalk = require('chalk');
|
||||
|
||||
exports.command = ['uninstall <language> [language-version]'];
|
||||
exports.command = ['uninstall <language> [language_version]'];
|
||||
exports.aliases = ['u'];
|
||||
exports.describe = 'Uninstalls the named package';
|
||||
|
||||
|
@ -10,12 +10,13 @@ const msg_format = {
|
|||
json: JSON.stringify
|
||||
};
|
||||
|
||||
exports.handler = async ({ axios, language, version }) => {
|
||||
exports.handler = async ({ axios, language, language_version }) => {
|
||||
try {
|
||||
const install = await axios.delete(`/api/v2/packages`, {
|
||||
const request = {
|
||||
language,
|
||||
version: version || '*'
|
||||
});
|
||||
version: language_version || '*'
|
||||
};
|
||||
const uninstall = await axios.delete(`/api/v2/packages`, {data: request});
|
||||
|
||||
console.log(msg_format.color(uninstall.data));
|
||||
} catch ({ response }) {
|
||||
|
|
Loading…
Reference in New Issue