Skip to content

Commit

Permalink
BREAKING: Drop Node 10 support Merge pull request #27 from inukshuk/m…
Browse files Browse the repository at this point in the history
…aster
  • Loading branch information
feross authored Nov 3, 2020
2 parents f5cd524 + df07b27 commit 732c42f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ var cp = require('child_process')
var fs = require('fs')
var os = require('os')
var path = require('path')
var rimraf = require('rimraf')

function zip (inPath, outPath, cb) {
if (!cb) cb = function () {}
Expand Down Expand Up @@ -47,7 +46,7 @@ function zip (inPath, outPath, cb) {
// Windows zip command does not overwrite existing files. So do it manually first.
function doZip () {
if (process.platform === 'win32') {
rimraf(outPath, doZip2)
fs.rmdir(outPath, { recursive: true, maxRetries: 3 }, doZip2)
} else {
doZip2()
}
Expand All @@ -73,7 +72,7 @@ function zipSync (inPath, outPath) {
fs.writeFileSync(path.join(tmpPath, path.basename(inPath)), inFile)
inPath = tmpPath
}
rimraf.sync(outPath)
fs.rmdirSync(outPath, { recursive: true, maxRetries: 3 })
}
var opts = {
cwd: path.dirname(inPath),
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"scripts": {
"test": "standard && tape test/*.js"
},
"dependencies": {
"rimraf": "^3.0.0"
"engines": {
"node": ">=12.10"
},
"funding": [
{
Expand Down
7 changes: 3 additions & 4 deletions test/unzip.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var fs = require('fs')
var path = require('path')
var rimraf = require('rimraf')
var test = require('tape')
var zip = require('../')

Expand All @@ -12,7 +11,7 @@ fs.mkdirSync(tmpPath, { recursive: true })

test('unzipSync', function (t) {
var tmpFilePath = path.join(tmpPath, 'file.txt')
rimraf.sync(tmpFilePath)
fs.rmdirSync(tmpFilePath, { recursive: true })
zip.unzipSync(fileZipPath, tmpPath)

var tmpFile = fs.readFileSync(tmpFilePath)
Expand All @@ -26,7 +25,7 @@ test('unzip', function (t) {
t.plan(3)

var tmpFilePath = path.join(tmpPath, 'file.txt')
rimraf(tmpFilePath, function (err) {
fs.rmdir(tmpFilePath, { recursive: true }, function (err) {
t.error(err)

zip.unzip(fileZipPath, tmpPath, function (err) {
Expand All @@ -48,7 +47,7 @@ test('unzip from a folder with a space in it', function (t) {
fs.copyFileSync(fileZipPath, zipSpacePath)

var tmpFilePath = path.join(tmpPath, 'file.txt')
rimraf(tmpFilePath, function (err) {
fs.rmdir(tmpFilePath, { recursive: true }, function (err) {
t.error(err)

zip.unzip(zipSpacePath, tmpPath, function (err) {
Expand Down
5 changes: 2 additions & 3 deletions test/zip.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var fs = require('fs')
var path = require('path')
var rimraf = require('rimraf')
var test = require('tape')
var zip = require('../')

Expand All @@ -14,7 +13,7 @@ test('zipSync', function (t) {
zip.zipSync(filePath, tmpFileZipPath)

var tmpFilePath = path.join(tmpPath, 'file.txt')
rimraf.sync(tmpFilePath)
fs.rmdirSync(tmpFilePath, { recursive: true })
zip.unzipSync(tmpFileZipPath, tmpPath)

var tmpFile = fs.readFileSync(tmpFilePath)
Expand All @@ -32,7 +31,7 @@ test('zip', function (t) {
t.error(err)

var tmpFilePath = path.join(tmpPath, 'file.txt')
rimraf(tmpFilePath, function (err) {
fs.rmdir(tmpFilePath, { recursive: true }, function (err) {
t.error(err)

zip.unzip(tmpFileZipPath, tmpPath, function (err) {
Expand Down

0 comments on commit 732c42f

Please sign in to comment.