Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
metelkin committed Jan 15, 2025
1 parent 237a68d commit ad8145d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions bin/heta-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ program
// cli level
.option('-d, --declaration <filepath>', 'declaration file name without extension to search throught extensions: ["", ".json", ".yml"]')
.option('--skip-updates', 'Skip checking newer version of heta-compiler.') // checking newer version of heta-compiler
.option('--log-level <debug|info|warn|error|crit>', 'Set log level to display.')
.option('--log-level <debug|info|warn|error|crit>', 'Set log level to display.', 'info')
.option('-L, --log-mode <never|error|always>', 'When to create log file.', 'error')
.option('--log-path <filepath>', 'Set log file path.', 'build.log')
//.options('--log-format <json|text>', 'Set log format.', 'text') // not implemented
Expand Down Expand Up @@ -71,9 +71,6 @@ async function main() {
// set targetDir as working directory
process.chdir(targetDir);

// set minimal log level
let logLevel = cliOptions.logLevel || 'info';

// 0. empty declaration
let declaration = {options: {}, importModule: {}, export: []};

Expand Down Expand Up @@ -130,8 +127,8 @@ async function main() {
fs.readFileSync,
fs.outputFileSync,
[
new StdoutTransport(logLevel), // log to stdout
new FileTransport(logLevel, logStream) // log to file
new StdoutTransport(cliOptions.logLevel), // log to stdout
new FileTransport(cliOptions.logLevel, logStream) // log to file
]
).run();

Expand Down
2 changes: 1 addition & 1 deletion src/module-system/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ModuleSystem {
*
* @returns {_Module} Created module.
*/
addModule(filename, type='heta', options = {}){
addModule(filename, type = 'heta', options = {}){
// parse
let parsed = this.createModule(filename, type, options);

Expand Down

0 comments on commit ad8145d

Please sign in to comment.