Skip to content

Commit

Permalink
Unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Oct 7, 2024
1 parent 6105dc6 commit 1635e35
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions shared/worklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,17 @@ exports.start = function start (filename, source, assets) {

if (source === null) source = protocol.read(url)

switch (path.extname(url.href)) {
case '.bundle': {
if (assets) {
const bundle = Bundle.from(source)
if (assets && path.extname(url.href) === '.bundle') {
const bundle = Bundle.from(source)

fs.mkdirSync(assets, { recursive: true })
fs.mkdirSync(assets, { recursive: true })

for (const asset of bundle.assets) {
const target = path.join(assets, asset)
for (const asset of bundle.assets) {
const target = path.join(assets, asset)

if (fs.existsSync(target)) continue
if (fs.existsSync(target)) continue

fs.writeFileSync(target, bundle.read(asset))
}
}
fs.writeFileSync(target, bundle.read(asset))
}
}

Expand Down

0 comments on commit 1635e35

Please sign in to comment.