Skip to content

Commit

Permalink
delete log
Browse files Browse the repository at this point in the history
  • Loading branch information
PayneFuRC committed Mar 23, 2024
1 parent 5cc4902 commit 8d7aa73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
15 changes: 2 additions & 13 deletions packages/app-builder-lib/src/asar/asarUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { ResolvedFileSet } from "../util/appFileCopier"
import { AsarFilesystem, Node } from "./asar"
import { hashFile, hashFileContents } from "./integrity"
import { detectUnpackedDirs } from "./unpackDetector"
import { NODE_MODULES_PATTERN } from "../fileTransformer"

// eslint-disable-next-line @typescript-eslint/no-var-requires
const pickle = require("chromium-pickle-js")
Expand Down Expand Up @@ -55,19 +54,9 @@ function getDestinationPath(file: string, fileSet: ResolvedFileSet) {
const src = fileSet.src
const dest = fileSet.destination
if (file.length > src.length && file.startsWith(src) && file[src.length] === path.sep) {
return (dest + file.substring(src.length)).replace(`${path.sep}.pnpm`, "")
return dest + file.substring(src.length)
} else {
// hoisted node_modules
// not lastIndexOf, to ensure that nested module (top-level module depends on) copied to parent node_modules, not to top-level directory
// project https://github.com/angexis/punchcontrol/commit/cf929aba55c40d0d8901c54df7945e1d001ce022
let index = file.indexOf(NODE_MODULES_PATTERN)
if (index < 0 && file.endsWith(`${path.sep}node_modules`)) {
index = file.length - 13
}
if (index < 0) {
throw new Error(`File "${file}" not under the source directory "${fileSet.src}"`)
}
return generateNewPath(file, dest).replace(`${path.sep}.pnpm`, "")
return generateNewPath(file, dest)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/app-builder-lib/src/util/NodeModuleCopyHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export class NodeModuleCopyHelper extends FileCopyHelper {
let tmpPath = baseDir + path.sep + moduleName
if (!fs.existsSync(tmpPath)) {
tmpPath = (await findNodeModulesWithFile(baseDir, moduleName)) + path.sep + moduleName
console.log("xxxxx,", tmpPath)
}
queue.length = 1
// The path should be corrected in Windows that when the moduleName is Scoped packages named.
Expand Down

0 comments on commit 8d7aa73

Please sign in to comment.