Migrating from v0.5.3 to v0.6 - shelljs/shelljs GitHub Wiki
Did we miss any features you like? Did we skip over any breaking changes you found? Feel free to document them below.
Breaking changes
- Bash compat: The semantics of
ln('-s', ...)
changed slightly. Relative symbolic links are now relative to the destination, not to the source like they were in v0.5.3. If you notice that your links break, you may be able to use absolute symbolic links instead usingpath.resolve()
. - Bash compat:
mv()
andcp()
now use the-f
flag by default. Previously,mv(srcFile, destFile)
would complain ifdestFile
already existed. If you need the old behavior back, use the-n
(no-clobber) option. - We introduced a bug...
cp('-r', 'file.txt', 'file2.txt')
('-r' on regular files) fails inv0.6
. This was unintentional, and has been fixed inv0.7
. As a workaround, usecp()
with the-r
flag only for directories (which still works :+1:). - Deprecated:
exec()
used to return an object that looks like{code: ..., output: ...}
. It now returns an object that looks like{code: ..., stdout: ..., stderr: ..., output: ...}
. The.output
attribute is deprecated.
Awesome features
- This actually runs on Windows! We added Appveyor CI for
v0.6
, and got many of our functions fixed to be Windows compatible (special thanks to BYK). - Bash compat: You can use
~/
to specify your home directory! - Bash compat:
cd()
goes to your home directory,cd('-')
jumps back to the previous directory. ls('-l')
andls('-d')
are now available.- New command:
touch()
- create files, modify timestamps, etc. - New command:
set()
- edit configuration variables easily (try outset('-e')
)