Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: isaacs/rimraf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.6.3
Choose a base ref
...
head repository: isaacs/rimraf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.7.0
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Aug 14, 2019

  1. feat: make it possible to omit glob dependency

    PR-URL: #192
    Credit: @bcoe
    Close: #192
    Reviewed-by: @isaacs
    bcoe authored and isaacs committed Aug 14, 2019
    2

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dc1682d View commit details
  2. 2.7.0

    isaacs committed Aug 14, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    250ee15 View commit details
Showing with 11 additions and 3 deletions.
  1. +1 −1 package-lock.json
  2. +1 −1 package.json
  3. +9 −1 rimraf.js
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rimraf",
"version": "2.6.3",
"version": "2.7.0",
"main": "rimraf.js",
"description": "A deep deletion module for node (like `rm -rf`)",
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
10 changes: 9 additions & 1 deletion rimraf.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,12 @@ rimraf.sync = rimrafSync
var assert = require("assert")
var path = require("path")
var fs = require("fs")
var glob = require("glob")
let glob = undefined
try {
glob = require("glob")
} catch (_err) {
// treat glob as optional.
}
var _0666 = parseInt('666', 8)

var defaultGlobOpts = {
@@ -37,6 +42,9 @@ function defaults (options) {
if (options.glob === false) {
options.disableGlob = true
}
if (options.disableGlob !== true && glob === undefined) {
throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')
}
options.disableGlob = options.disableGlob || false
options.glob = options.glob || defaultGlobOpts
}