start integration of Smartshell class
This commit is contained in:
33
ts/index.ts
33
ts/index.ts
@ -1,32 +1 @@
|
||||
import * as plugins from './smartshell.plugins'
|
||||
|
||||
|
||||
|
||||
export interface IExecResult {
|
||||
exitCode: number,
|
||||
consoleOutput: string
|
||||
}
|
||||
|
||||
export let exec = (commandStringArg: string): Promise<IExecResult> => {
|
||||
let done = plugins.smartq.defer<IExecResult>()
|
||||
plugins.shelljs.exec(commandStringArg,{async: true}, (code, stdout, stderr) => {
|
||||
|
||||
})
|
||||
return done.promise
|
||||
}
|
||||
|
||||
export let execSilent = (commandStringArg: string) => {
|
||||
let done = plugins.smartq.defer<IExecResult>()
|
||||
plugins.shelljs.exec(commandStringArg,{}, () => {
|
||||
|
||||
})
|
||||
return done.promise
|
||||
}
|
||||
|
||||
export let execSync = () => {
|
||||
|
||||
}
|
||||
|
||||
export let execSyncSilent = () => {
|
||||
|
||||
}
|
||||
export * from './smartshell.wrap'
|
||||
|
16
ts/smartshell.classes.smartshell.ts
Normal file
16
ts/smartshell.classes.smartshell.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import * as plugins from './smartshell.plugins'
|
||||
import * as smartshellWrap from './smartshell.wrap'
|
||||
|
||||
export type TExecutor = 'sh' | 'bash'
|
||||
|
||||
export interface ISmartshellContructorOptions {
|
||||
executor: TExecutor
|
||||
sourceFiles: string[]
|
||||
|
||||
}
|
||||
|
||||
export class Smartshell {
|
||||
constructor() {
|
||||
|
||||
}
|
||||
}
|
28
ts/smartshell.wrap.ts
Normal file
28
ts/smartshell.wrap.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import * as plugins from './smartshell.plugins'
|
||||
|
||||
export interface IExecResult {
|
||||
exitCode: number,
|
||||
stdout: string
|
||||
}
|
||||
|
||||
export let exec = (commandStringArg: string): Promise<IExecResult> => {
|
||||
let done = plugins.smartq.defer<IExecResult>()
|
||||
plugins.shelljs.exec(commandStringArg,{async: true}, (code, stdout, stderr) => {
|
||||
done.resolve({
|
||||
exitCode: code,
|
||||
stdout: stdout
|
||||
})
|
||||
})
|
||||
return done.promise
|
||||
}
|
||||
|
||||
export let execSilent = (commandStringArg: string) => {
|
||||
let done = plugins.smartq.defer<IExecResult>()
|
||||
plugins.shelljs.exec(commandStringArg,{async: true, silent: true}, (code, stdout, stderr) => {
|
||||
done.resolve({
|
||||
exitCode: code,
|
||||
stdout: stdout
|
||||
})
|
||||
})
|
||||
return done.promise
|
||||
}
|
Reference in New Issue
Block a user