From 46402ea53360b4e64f651a26ecba76fc811f6e08 Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Sun, 13 Mar 2016 15:43:42 -0700 Subject: [PATCH 1/3] docs: add link to wiki page --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29fcd22..b6e5dfe 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,10 @@ The project is [unit-tested](http://travis-ci.org/shelljs/shelljs) and battled-t If you have feedback, suggestions, or need help, feel free to post in our [issue tracker](https://github.com/shelljs/shelljs/issues). -For a non-programmatic implementation of Unix shell commands on top of Node.js, check out [Cash](https://github.com/dthree/cash). +Think ShellJS is cool? Check out some related projects (like +[cash](https://github.com/dthree/cash)--a javascript-based POSIX shell--or +[shx](https://github.com/shelljs/shx)--ShellJS functions exposed straight to +your commandline) in our [Wiki page](https://github.com/shelljs/shelljs/wiki)! ## Installing From 4078f26a20f70eeeee17d5955af42542b1a7818a Mon Sep 17 00:00:00 2001 From: Ari Porad Date: Wed, 16 Mar 2016 19:34:41 -0700 Subject: [PATCH 2/3] WIP: docs(README): give shx a more prominent posision --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b6e5dfe..7658f52 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,19 @@ The project is [unit-tested](http://travis-ci.org/shelljs/shelljs) and battled-t If you have feedback, suggestions, or need help, feel free to post in our [issue tracker](https://github.com/shelljs/shelljs/issues). Think ShellJS is cool? Check out some related projects (like -[cash](https://github.com/dthree/cash)--a javascript-based POSIX shell--or -[shx](https://github.com/shelljs/shx)--ShellJS functions exposed straight to -your commandline) in our [Wiki page](https://github.com/shelljs/shelljs/wiki)! +[cash](https://github.com/dthree/cash)--a javascript-based POSIX shell) +in our [Wiki page](https://github.com/shelljs/shelljs/wiki)! + +## Command line use +If you just want cross platform UNIX commands, checkout [`shx`](https://github.com/shelljs/shx). +It exposes `shelljs` to the command line. + +For example: +``` +$ shx mkdir -p foo +$ shx touch foo/bar.txt +$ shx rm -rf foo +``` ## Installing From 3daa0db7e500922585f702de4ae10f8c291e5d5b Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Sun, 20 Mar 2016 01:00:14 -0700 Subject: [PATCH 3/3] docs: move make tool docs to the wiki --- README.md | 60 ++++++++----------------------------------------------- shell.js | 3 +++ 2 files changed, 11 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 7658f52..ff6d73a 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,13 @@ Think ShellJS is cool? Check out some related projects (like in our [Wiki page](https://github.com/shelljs/shelljs/wiki)! ## Command line use -If you just want cross platform UNIX commands, checkout [`shx`](https://github.com/shelljs/shx). -It exposes `shelljs` to the command line. + +If you just want cross platform UNIX commands, checkout our new project +[shelljs/shx](https://github.com/shelljs/shx), a utility to expose `shelljs` to +the command line. For example: + ``` $ shx mkdir -p foo $ shx touch foo/bar.txt @@ -125,56 +128,6 @@ var shell = require('shelljs'); shell.echo('hello world'); ``` -## Make tool - -A convenience script `shelljs/make` is also provided to mimic the behavior of a Unix Makefile. -In this case all shell objects are global, and command line arguments will cause the script to -execute only the corresponding function in the global `target` object. To avoid redundant calls, -target functions are executed only once per script. - -Example: - -```javascript -require('shelljs/make'); - -target.all = function() { - target.bundle(); - target.docs(); -}; - -target.bundle = function() { - cd(__dirname); - mkdir('-p', 'build'); - cd('src'); - cat('*.js').to('../build/output.js'); -}; - -target.docs = function() { - cd(__dirname); - mkdir('-p', 'docs'); - var files = ls('src/*.js'); - for(var i = 0; i < files.length; i++) { - var text = grep('//@', files[i]); // extract special comments - text = text.replace(/\/\/@/g, ''); // remove comment tags - text.toEnd('docs/my_docs.md'); - } -}; -``` - -To run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`. - -You can also pass arguments to your targets by using the `--` separator. For example, to pass `arg1` and `arg2` to a target `bundle`, do `$ node make bundle -- arg1 arg2`: - -```javascript -require('shelljs/make'); - -target.bundle = function(argsArray) { - // argsArray = ['arg1', 'arg2'] - /* ... */ -} -``` - - @@ -183,6 +136,9 @@ target.bundle = function(argsArray) { All commands run synchronously, unless otherwise stated. +For less-commonly used commands and features, please check out our [wiki +page](https://github.com/shelljs/shelljs/wiki). + ### cd([dir]) Changes to directory `dir` for the duration of the script. Changes to home diff --git a/shell.js b/shell.js index 51ff397..f9e1594 100644 --- a/shell.js +++ b/shell.js @@ -12,6 +12,9 @@ var common = require('./src/common'); //@ //@ All commands run synchronously, unless otherwise stated. //@ +//@ For less-commonly used commands and features, please check out our [wiki +//@ page](https://github.com/shelljs/shelljs/wiki). +//@ //@include ./src/cd var _cd = require('./src/cd');