mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-24 22:52:13 +00:00
Fix an issue with the --lib argument in asc and allow specifying files (#42)
This commit is contained in:
parent
5eb10d404f
commit
9511e2618d
1
NOTICE
1
NOTICE
@ -6,6 +6,7 @@ under the licensing terms detailed in LICENSE.
|
||||
* Daniel Wirtz <dcode@dcode.io>
|
||||
* Max Graey <maxgraey@gmail.com>
|
||||
* Igor Sbitnev <PinkaminaDianePie@gmail.com>
|
||||
* Norton Wang <me@nortonwang.com>
|
||||
|
||||
================================================================================
|
||||
|
||||
|
10
bin/asc.js
10
bin/asc.js
@ -157,7 +157,7 @@ exports.main = function main(argv, options, callback) {
|
||||
if (typeof args.lib === "string") {
|
||||
args.lib = args.lib.split(",");
|
||||
}
|
||||
Array.prototype.push.apply(libDirs, args.lib.map(trim));
|
||||
Array.prototype.push.apply(libDirs, args.lib.map(lib => lib.trim()));
|
||||
}
|
||||
|
||||
// Begin parsing
|
||||
@ -267,7 +267,13 @@ exports.main = function main(argv, options, callback) {
|
||||
for (let i = 0, k = libDirs.length; i < k; ++i) {
|
||||
if (i === 0 && hasBundledLibrary) continue;
|
||||
let libDir = libDirs[i];
|
||||
let libFiles = listFiles(libDir);
|
||||
let libFiles;
|
||||
if (libDir.endsWith(".ts")) {
|
||||
libFiles = [path.basename(libDir)];
|
||||
libDir = path.dirname(libDir);
|
||||
} else {
|
||||
libFiles = listFiles(libDir);
|
||||
}
|
||||
for (let j = 0, l = libFiles.length; j < l; ++j) {
|
||||
let libPath = libFiles[j];
|
||||
let libText = readFile(path.join(libDir, libPath));
|
||||
|
Loading…
x
Reference in New Issue
Block a user