commit 26ed390ba6076b7d6f4186a707b8ebe0583981ec Author: Phil Kunz Date: Sun Feb 12 13:13:08 2017 +0100 initial diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26b6673 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +coverage/ +node_modules/ +pages/ +public/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..7c7a9d3 --- /dev/null +++ b/README.md @@ -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) diff --git a/package.json b/package.json new file mode 100644 index 0000000..0209c3f --- /dev/null +++ b/package.json @@ -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" + } +} diff --git a/test/test.ts b/test/test.ts new file mode 100644 index 0000000..051b558 --- /dev/null +++ b/test/test.ts @@ -0,0 +1,6 @@ +import 'typings-test' +import { expect } from 'smartchai' + +describe('smartshell', function() { + +}) \ No newline at end of file diff --git a/ts/index.ts b/ts/index.ts new file mode 100644 index 0000000..2acc335 --- /dev/null +++ b/ts/index.ts @@ -0,0 +1,32 @@ +import * as plugins from './smartshell.plugins' + + + +export interface IExecResult { + exitCode: number, + consoleOutput: string +} + +export let exec = (commandStringArg: string): Promise => { + let done = plugins.smartq.defer() + plugins.shelljs.exec(commandStringArg,{async: true}, (code, stdout, stderr) => { + + }) + return done.promise +} + +export let execSilent = (commandStringArg: string) => { + let done = plugins.smartq.defer() + plugins.shelljs.exec(commandStringArg,{}, () => { + + }) + return done.promise +} + +export let execSync = () => { + +} + +export let execSyncSilent = () => { + +} diff --git a/ts/smartshell.plugins.ts b/ts/smartshell.plugins.ts new file mode 100644 index 0000000..075d172 --- /dev/null +++ b/ts/smartshell.plugins.ts @@ -0,0 +1,7 @@ +import * as shelljs from 'shelljs' +import * as smartq from 'smartq' + +export { + shelljs, + smartq +} \ No newline at end of file