mirror of
https://github.com/shelljs/shelljs.git
synced 2026-01-18 16:03:37 +00:00
WebPack has issues with importing JSON directly and using JavaScript methods on it. For this reason, using the `.forEach()` method on the imported JSON array caused a method-not-found error. Instead, we can make this a real JavaScript array by keeping it in a JavaScript file and exporting it as a field. It should be noted that exporting it as `exports = [...]` does not work, because Node won't actually interpret it as a JavaScript array (with the required methods). So instead we can export it as `exports.list = [...]` and access the `list` field to get the real JavaScript array of command names. Fixes #667
30 lines
282 B
JavaScript
30 lines
282 B
JavaScript
module.exports = [
|
|
'cat',
|
|
'cd',
|
|
'chmod',
|
|
'cp',
|
|
'dirs',
|
|
'echo',
|
|
'exec',
|
|
'find',
|
|
'grep',
|
|
'head',
|
|
'ln',
|
|
'ls',
|
|
'mkdir',
|
|
'mv',
|
|
'pwd',
|
|
'rm',
|
|
'sed',
|
|
'set',
|
|
'sort',
|
|
'tail',
|
|
'tempdir',
|
|
'test',
|
|
'to',
|
|
'toEnd',
|
|
'touch',
|
|
'uniq',
|
|
'which',
|
|
];
|