Skip to content

Commit

Permalink
fix: Windows path on glob 9
Browse files Browse the repository at this point in the history
  • Loading branch information
theogravity committed Mar 8, 2024
1 parent 6aa6a9a commit f3ccc3a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/asar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const minimatch = require('minimatch')
const Filesystem = require('./filesystem')
const disk = require('./disk')
const crawlFilesystem = require('./crawlfs')
const os = require('os')

/**
* Whether a directory should be excluded from packing due to the `--unpack-dir" option.
Expand Down Expand Up @@ -34,6 +35,12 @@ module.exports.createPackageWithOptions = async function (src, dest, options) {
const globOptions = options.globOptions ? options.globOptions : {}
globOptions.dot = options.dot === undefined ? true : options.dot

// https://github.com/isaacs/node-glob/issues/480
if (os.platform() === 'win32') {
src = src.split(path.sep).join('/')
dest = dest.split(path.sep).join('/')
}

const pattern = src + (options.pattern ? options.pattern : '/**/*')

const [filenames, metadata] = await crawlFilesystem(pattern, globOptions)
Expand Down

0 comments on commit f3ccc3a

Please sign in to comment.