Skip to content

Commit

Permalink
fix: read the path to generate banks
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Mar 4, 2024
1 parent 57e13b3 commit 9151927
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export const tokens = (
* @param {boolean} [options.stripComments=false]
* @param {boolean} [options.validate=false]
* @param {boolean} [options.defines=false]
* @param {boolean} [options.cwd=process.cwd()]
* @returns {Uint8Array}
*/
export const file2bas = (src, options = {}) => {
Expand All @@ -155,6 +156,7 @@ export const file2bas = (src, options = {}) => {
format = '3dos',
binary = false, // used if source has UDGs
includeHeader = true,
cwd = '.',
...parseOptions
} = options;

Expand Down Expand Up @@ -214,7 +216,9 @@ export const file2bas = (src, options = {}) => {
directives: { ...directives, filename: bank.filename },
});
// save the bank as a file
require('fs').writeFileSync(bank.filename, Buffer.from(file));
const { join } = require('path');

require('fs').writeFileSync(join(cwd, bank.filename), Buffer.from(file));
});
// generate the file, but also save the actual banks as files
return file;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"basic"
],
"engines": {
"node": "12"
"node": ">=12"
},
"author": "Remy Sharp",
"license": "MIT",
Expand Down

0 comments on commit 9151927

Please sign in to comment.