Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

del is an alias for a native Windows command #19

Closed
sparty02 opened this issue Mar 22, 2015 · 10 comments
Closed

del is an alias for a native Windows command #19

sparty02 opened this issue Mar 22, 2015 · 10 comments

Comments

@sparty02
Copy link

I hesitate to even open this issue because I'm not even sure how you would go about addressing this, but it's a heads up, if anything. 'del' is an alias for the native Windows command for removing things. In essence, it kinda does what this module does, but natively. Unfortunately since the syntaxes differ, this node module throws errors when running on Windows....either when installed globally or, in my case, via an npm run script a la:

"scripts": {
    "clean": "del dist/*"
}

rimraf avoids these issues (because rimraf isn't an alias for anyting in Windows), but you've obviously made some improvements to rimraf functionality via the notes in your documentation.

@kevva
Copy link
Contributor

kevva commented Mar 22, 2015

"scripts": {
    "clean": "node_modules/.bin/del dist/*"
}

@sparty02
Copy link
Author

@kevva That doesn't work. "node_modules/.bin/del" doesn't exist on a local del install.

@kevva
Copy link
Contributor

kevva commented Mar 22, 2015

On a local install it should definitely exist. On a global install it doesn't though.

nvm, this doesn't have a CLI so no wonder it doesn't work for you. Use trash if you need CLI functionality. This module only works when required as seen in the usage instructions.

@kevva kevva closed this as completed Mar 22, 2015
@sparty02
Copy link
Author

@kevva I just created a new module. Ran:

npm install del

There is no node_modules/.bin/del directory! There is a node_modules\del\node_modules\.bin directory which, ironically, has rimraf in it.

@sparty02
Copy link
Author

As a matter of fact, it looks like even a global install of del (on Windows) doesn't attempt to alias del! Not sure why this issue was closed so quick.

_global rimraf install:_

PS C:\Users\e1031513\dev\projects\temp> npm install -g rimraf
C:\Users\e1031513\AppData\Roaming\npm\rimraf -> C:\Users\e1031513\AppData\Roaming\npm\node_modules\rimraf\bin.js
rimraf@2.3.2 C:\Users\e1031513\AppData\Roaming\npm\node_modules\rimraf
└── glob@4.5.3 (inherits@2.0.1, once@1.3.1, inflight@1.0.4, minimatch@2.0.4)

_global del install:_

PS C:\Users\e1031513\dev\projects\temp> npm install -g del
del@1.1.1 C:\Users\e1031513\AppData\Roaming\npm\node_modules\del
├── is-path-cwd@1.0.0
├── object-assign@2.0.0
├── each-async@1.1.1 (set-immediate-shim@1.0.1, onetime@1.0.0)
├── is-path-in-cwd@1.0.0 (is-path-inside@1.0.0)
├── rimraf@2.3.2 (glob@4.5.3)
└── globby@1.2.0 (async@0.9.0, array-union@1.0.1, glob@4.5.3)

@kevva
Copy link
Contributor

kevva commented Mar 22, 2015

There is no node_modules/.bin/del directory!

Because it doesn't have a CLI.

As a matter of fact, it looks like even a global install of del (on Windows) doesn't attempt to alias del!

Why would it?

@sparty02
Copy link
Author

I don't really care that much about the lack of a global install (although rimraf does support one and this module appears to be a superset improvement of rimraf). What I originally wanted to do was just simply use this in a simple npm "clean" script task. I was previously using rm -rf in the task, but that's doesn't have cross platform support without something like cygwin or winbash or something.

Not a huge deal, just inconvenient.

@kevva
Copy link
Contributor

kevva commented Mar 22, 2015

Yeah, that's what trash is for. Your code would look like this instead:

"scripts": {
    "clean": "trash dist/*"
}

@sparty02
Copy link
Author

trash is great, but the files I'm working with are inherently volatile (they are derived files from a build). I would never want to recover these, because they are all derived from a build; hence "putting them in the trash" is simply a waste of disk space in my scenario.

@kevva
Copy link
Contributor

kevva commented Mar 22, 2015

Yeah, then rimraf is the way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants