Skip to content

Commit

Permalink
OS X → macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jun 14, 2016
1 parent d32fce9 commit 73c5b99
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* text=auto
*.js text eol=lf
lib/osx-trash binary
lib/macos-trash binary
lib/win-trash.exe binary
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function (paths) {
}

switch (process.platform) {
case 'darwin': return require('./lib/osx')(paths);
case 'darwin': return require('./lib/macos')(paths);
case 'win32': return require('./lib/win')(paths);
default: return require('./lib/linux')(paths);
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/osx.js → lib/macos.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var runApplescript = require('run-applescript');
var pify = require('pify');
var Promise = require('pinkie-promise');
var olderThanMountainLion = Number(os.release().split('.')[0]) < 12;
var bin = path.join(__dirname, 'osx-trash');
var bin = path.join(__dirname, 'macos-trash');

function legacy(paths) {
var script =
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Build Status](https://travis-ci.org/sindresorhus/trash.svg?branch=master)](https://travis-ci.org/sindresorhus/trash)

Works on OS X, Linux, and Windows.
Works on macOS, Linux, and Windows.

In contrast to [`fs.unlink`](https://nodejs.org/api/fs.html#fs_fs_unlink_path_callback), [`del`](https://github.com/sindresorhus/del), and [`rimraf`](https://github.com/isaacs/rimraf) which permanently delete files, this only moves them to the trash, which is much safer and reversible.

Expand Down Expand Up @@ -40,7 +40,7 @@ $ npm install --global trash-cli

## Info

On OS X, [`osx-trash`](https://github.com/sindresorhus/osx-trash) is used.
On macOS, [`macos-trash`](https://github.com/sindresorhus/macos-trash) is used.
On Linux, the [XDG spec](http://standards.freedesktop.org/trash-spec/trashspec-1.0.html) is followed.
On Windows, [`recycle-bin`](https://github.com/sindresorhus/recycle-bin) is used.

Expand All @@ -49,7 +49,7 @@ On Windows, [`recycle-bin`](https://github.com/sindresorhus/recycle-bin) is used

### But I can do the same thing with `mv`

Not really. The `mv` command isn't cross-platform and moving to trash is not just about moving the file to a "trash" directory. On all OSes you'll run into file conflicts. The user won't easily be able to restore the file. It won't work on an external drive. The trash directory location varies between Windows versions. For Linux, there's a whole [spec](http://www.ramendik.ru/docs/trashspec.html) you need to follow. On OS X, you'll lose the [Put back](http://mac-fusion.com/trash-tip-how-to-put-files-back-to-their-original-location/) feature.
Not really. The `mv` command isn't cross-platform and moving to trash is not just about moving the file to a "trash" directory. On all OSes you'll run into file conflicts. The user won't easily be able to restore the file. It won't work on an external drive. The trash directory location varies between Windows versions. For Linux, there's a whole [spec](http://www.ramendik.ru/docs/trashspec.html) you need to follow. On macOS, you'll lose the [Put back](http://mac-fusion.com/trash-tip-how-to-put-files-back-to-their-original-location/) feature.


## Related
Expand Down

0 comments on commit 73c5b99

Please sign in to comment.