Skip to content

Commit 1ac38e6

Browse files
committed
Merge branch 'master' of github.com:facebook/fbkpm
2 parents ab350f5 + 9ecf496 commit 1ac38e6

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fbkpm",
3-
"version": "0.4.7",
3+
"version": "0.4.8",
44
"license": "BSD-3-Clause",
55
"preferGlobal": true,
66
"main": "./index.js",

src/cli/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ commander.usage("[command] [flags]");
3333
commander.option("--json", "");
3434
commander.option("--modules-folder [path]", "rather than installing modules into the node_modules " +
3535
"folder relative to the cwd, output them here");
36-
36+
commander.option("--packages-root [path]", "rather than storing modules into a global packages root," +
37+
"store them here");
3738
// get command name
3839
let commandName = args.splice(2, 1)[0] || "";
3940

@@ -77,7 +78,8 @@ reporter.initPeakMemoryCounter();
7778

7879
//
7980
let config = new Config(reporter, {
80-
modulesFolder: commander.modulesFolder
81+
modulesFolder: commander.modulesFolder,
82+
packagesRoot: commander.packagesRoot,
8183
});
8284

8385
// print header

src/config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ export default class Config {
9090
this.cwd = opts.cwd;
9191
}
9292

93-
this.packagesRoot = await this.getPackageRoot(opts);
93+
if (!this.packagesRoot) {
94+
this.packagesRoot = await this.getPackageRoot(opts);
95+
}
9496

9597
if (!this.tempFolder) {
9698
this.tempFolder = await this.getTempFolder();

src/package-linker.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export default class PackageLinker {
4040
config: Config;
4141

4242
async linkSelfDependencies(pkg: Manifest, pkgLoc: string, targetBinLoc: string): Promise<void> {
43+
targetBinLoc = await fs.realpath(targetBinLoc);
44+
pkgLoc = await fs.realpath(pkgLoc);
4345
for (let [scriptName, scriptCmd] of entries(pkg.bin)) {
4446
let dest = path.join(targetBinLoc, scriptName);
4547
let src = path.join(pkgLoc, scriptCmd);

src/util/fs.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,7 @@ export async function symlink(src: string, dest: string): Promise<void> {
153153
await fsSymlink(src, dest, "junction");
154154
} else {
155155
// use relative paths otherwise which will be retained if the directory is moved
156-
let relative = src;
157-
if (path.isAbsolute(relative)) {
158-
relative = path.relative(path.dirname(dest), src);
159-
}
160-
156+
let relative = path.relative(path.dirname(dest), src);
161157
await fsSymlink(relative, dest);
162158
}
163159
} catch (err) {

0 commit comments

Comments
 (0)