You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b67b94c
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+7-51Lines changed: 7 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,10 +28,13 @@ Think ShellJS is cool? Check out some related projects (like
28
28
in our [Wiki page](https://github.com/shelljs/shelljs/wiki)!
29
29
30
30
## Command line use
31
-
If you just want cross platform UNIX commands, checkout [`shx`](https://github.com/shelljs/shx).
32
-
It exposes `shelljs` to the command line.
31
+
32
+
If you just want cross platform UNIX commands, checkout our new project
33
+
[shelljs/shx](https://github.com/shelljs/shx), a utility to expose `shelljs` to
34
+
the command line.
33
35
34
36
For example:
37
+
35
38
```
36
39
$ shx mkdir -p foo
37
40
$ shx touch foo/bar.txt
@@ -125,55 +128,8 @@ var shell = require('shelljs');
125
128
shell.echo('hello world');
126
129
```
127
130
128
-
## Make tool
129
-
130
-
A convenience script `shelljs/make` is also provided to mimic the behavior of a Unix Makefile.
131
-
In this case all shell objects are global, and command line arguments will cause the script to
132
-
execute only the corresponding function in the global `target` object. To avoid redundant calls,
133
-
target functions are executed only once per script.
134
-
135
-
Example:
136
-
137
-
```javascript
138
-
require('shelljs/make');
139
-
140
-
target.all=function() {
141
-
target.bundle();
142
-
target.docs();
143
-
};
144
-
145
-
target.bundle=function() {
146
-
cd(__dirname);
147
-
mkdir('-p', 'build');
148
-
cd('src');
149
-
cat('*.js').to('../build/output.js');
150
-
};
151
-
152
-
target.docs=function() {
153
-
cd(__dirname);
154
-
mkdir('-p', 'docs');
155
-
var files =ls('src/*.js');
156
-
for(var i =0; i <files.length; i++) {
157
-
var text =grep('//@', files[i]); // extract special comments
158
-
text =text.replace(/\/\/@/g, ''); // remove comment tags
159
-
text.toEnd('docs/my_docs.md');
160
-
}
161
-
};
162
-
```
163
-
164
-
To run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`.
165
-
166
-
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`:
167
-
168
-
```javascript
169
-
require('shelljs/make');
170
-
171
-
target.bundle=function(argsArray) {
172
-
// argsArray = ['arg1', 'arg2']
173
-
/* ... */
174
-
}
175
-
```
176
-
131
+
For less-commonly used commands and features, please check out our [wiki
132
+
page](https://github.com/shelljs/shelljs/wiki).
177
133
178
134
<!-- DO NOT MODIFY BEYOND THIS POINT - IT'S AUTOMATICALLY GENERATED -->
0 commit comments