-
-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): fix path sep error in win, add docs, fix code styles
- Loading branch information
Showing
25 changed files
with
75 additions
and
215 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 |
---|---|---|
@@ -1,37 +1,33 @@ | ||
import * as Table from 'cli-table2' | ||
|
||
import {appList} from '../api/apps' | ||
import * as Table from 'cli-table2' | ||
import { appList } from '../api/apps' | ||
|
||
/** | ||
* apps list | ||
* @returns | ||
*/ | ||
|
||
export async function handleAppListCommand() { | ||
|
||
// get list | ||
const response = await appList() | ||
|
||
//init table | ||
const table = new Table({ | ||
head: ['appid', 'name','status'], | ||
}); | ||
head: ['appid', 'name', 'status'], | ||
}) | ||
|
||
// user create app | ||
if(response.data.created){ | ||
if (response.data.created) { | ||
response.data.created.forEach(app => { | ||
table.push([app.appid,app.name,app.status]) | ||
}); | ||
table.push([app.appid, app.name, app.status]) | ||
}) | ||
} | ||
|
||
// user join app | ||
if(response.data.joined){ | ||
if (response.data.joined) { | ||
response.data.joined.forEach(app => { | ||
table.push([app.appid,app.name,app.status]) | ||
}); | ||
table.push([app.appid, app.name, app.status]) | ||
}) | ||
} | ||
|
||
// show table | ||
console.log(table.toString()) | ||
|
||
} |
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
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
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 |
---|---|---|
@@ -1,30 +1,17 @@ | ||
import { getFunctionByName, } from "../api/functions" | ||
|
||
import { createRemoteFn, updateRemoteFn } from "../utils/function-push" | ||
|
||
|
||
|
||
/** | ||
* pull function | ||
* @param { appid} string | ||
* @param { functionName } string | ||
* @returns | ||
*/ | ||
export async function handlePushOneCommand(appid: string, functionName: string) { | ||
|
||
|
||
|
||
// get remote function | ||
const record = await getFunctionByName(appid, functionName) | ||
|
||
|
||
if (!record.data) { | ||
|
||
createRemoteFn(appid, functionName) | ||
} else { | ||
|
||
updateRemoteFn(appid, functionName) | ||
|
||
} | ||
|
||
} |
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
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
Oops, something went wrong.