Skip to content

Commit

Permalink
fixup! feat(builtin): use linker for all generated :bin targets
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Apr 11, 2020
1 parent e35d709 commit a168088
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions internal/linker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class Runfiles {
if (path.isAbsolute(modulePath)) {
return modulePath;
}
const result = this._resolve(modulePath, '');
const result = this._resolve(modulePath, undefined);
if (result) {
return result;
}
Expand All @@ -158,7 +158,7 @@ class Runfiles {
const result = this.lookupDirectory(moduleBase);
if (result) {
if (moduleTail) {
const maybe = path.join(result, moduleTail);
const maybe = path.join(result, moduleTail || '');
if (fs.existsSync(maybe)) {
return maybe;
}
Expand All @@ -169,7 +169,7 @@ class Runfiles {
}
}
if (exports.runfiles.dir) {
const maybe = path.join(exports.runfiles.dir, moduleBase, moduleTail);
const maybe = path.join(exports.runfiles.dir, moduleBase, moduleTail || '');
if (fs.existsSync(maybe)) {
return maybe;
}
Expand All @@ -178,7 +178,7 @@ class Runfiles {
if (dirname == '.') {
return undefined;
}
return this._resolve(dirname, path.join(path.basename(moduleBase), moduleTail));
return this._resolve(dirname, path.join(path.basename(moduleBase), moduleTail || ''));
}
resolveWorkspaceRelative(modulePath) {
if (!this.workspace) {
Expand Down
10 changes: 5 additions & 5 deletions internal/linker/link_node_modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class Runfiles {
if (path.isAbsolute(modulePath)) {
return modulePath;
}
const result = this._resolve(modulePath, '');
const result = this._resolve(modulePath, undefined);
if (result) {
return result;
}
Expand All @@ -255,12 +255,12 @@ export class Runfiles {
throw e;
}

_resolve(moduleBase: string, moduleTail: string): string|undefined {
_resolve(moduleBase: string, moduleTail: string|undefined): string|undefined {
if (this.manifest) {
const result = this.lookupDirectory(moduleBase);
if (result) {
if (moduleTail) {
const maybe = path.join(result, moduleTail);
const maybe = path.join(result, moduleTail || '');
if (fs.existsSync(maybe)) {
return maybe;
}
Expand All @@ -270,7 +270,7 @@ export class Runfiles {
}
}
if (runfiles.dir) {
const maybe = path.join(runfiles.dir, moduleBase, moduleTail);
const maybe = path.join(runfiles.dir, moduleBase, moduleTail || '');
if (fs.existsSync(maybe)) {
return maybe;
}
Expand All @@ -280,7 +280,7 @@ export class Runfiles {
// no match
return undefined;
}
return this._resolve(dirname, path.join(path.basename(moduleBase), moduleTail));
return this._resolve(dirname, path.join(path.basename(moduleBase), moduleTail || ''));
}

resolveWorkspaceRelative(modulePath: string) {
Expand Down

0 comments on commit a168088

Please sign in to comment.