mirror of
https://github.com/scratchfoundation/scratch-gui.git
synced 2024-11-25 16:26:20 +08:00
fix: update prepublish script to use correct path separator
This commit is contained in:
parent
a5bbc4c488
commit
216beb02da
@ -93,13 +93,17 @@ const downloadMicrobitHex = async () => {
|
||||
const absoluteGeneratedDir = path.join(basePath, relativeGeneratedDir);
|
||||
fs.mkdirSync(absoluteGeneratedDir, {recursive: true});
|
||||
const absoluteGeneratedFile = path.join(basePath, relativeGeneratedFile);
|
||||
const requirePath = `./${path
|
||||
.relative(relativeGeneratedDir, relativeHexFile)
|
||||
.split(path.win32.sep)
|
||||
.join(path.posix.sep)}`;
|
||||
fs.writeFileSync(
|
||||
absoluteGeneratedFile,
|
||||
[
|
||||
'// This file is generated by scripts/prepublish.mjs',
|
||||
'// Do not edit this file directly',
|
||||
'// This file relies on a loader to turn this `require` into a URL',
|
||||
`module.exports = require('./${path.relative(relativeGeneratedDir, relativeHexFile)}');`,
|
||||
`module.exports = require('${requirePath}');`,
|
||||
'' // final newline
|
||||
].join('\n')
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user