This commit is contained in:
Philipp Kunz 2017-02-12 13:13:08 +01:00
commit 26ed390ba6
6 changed files with 109 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
coverage/
node_modules/
pages/
public/

28
README.md Normal file
View File

@ -0,0 +1,28 @@
# smartshell
shell actions designed as promises
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartshell)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartshell)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartshell)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartshell/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartshell/badges/master/build.svg)](https://GitLab.com/pushrocks/smartshell/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartshell/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartshell/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartshell.svg)](https://www.npmjs.com/package/smartshell)
[![Dependency Status](https://david-dm.org/pushrocks/smartshell.svg)](https://david-dm.org/pushrocks/smartshell)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartshell/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartshell/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartshell/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartshell)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

32
package.json Normal file
View File

@ -0,0 +1,32 @@
{
"name": "smartshell",
"version": "1.0.0",
"description": "shell actions designed as promises",
"main": "dist/index.js",
"scripts": {
"test": "(npmts)"
},
"repository": {
"type": "git",
"url": "git+ssh://git@gitlab.com/pushrocks/smartshell.git"
},
"keywords": [
"shell",
"promise"
],
"author": "Lossless GmbH",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/pushrocks/smartshell/issues"
},
"homepage": "https://gitlab.com/pushrocks/smartshell#README",
"devDependencies": {
"smartchai": "^1.0.1",
"typings-test": "^1.0.3"
},
"dependencies": {
"@types/shelljs": "^0.6.0",
"shelljs": "^0.7.6",
"smartq": "^1.1.0"
}
}

6
test/test.ts Normal file
View File

@ -0,0 +1,6 @@
import 'typings-test'
import { expect } from 'smartchai'
describe('smartshell', function() {
})

32
ts/index.ts Normal file
View File

@ -0,0 +1,32 @@
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 = () => {
}

7
ts/smartshell.plugins.ts Normal file
View File

@ -0,0 +1,7 @@
import * as shelljs from 'shelljs'
import * as smartq from 'smartq'
export {
shelljs,
smartq
}