Factor out making latest meteor "symlink"

This commit is contained in:
Sashko Stubailo
2014-12-10 20:29:55 -08:00
parent b462b95111
commit fec2f8eaef
3 changed files with 7 additions and 8 deletions

View File

@@ -2143,12 +2143,11 @@ main.registerCommand({
var toolRecord = _.findWhere(toolIsopack.toolsOnDisk, {arch: osArch});
if (!toolRecord)
throw Error("missing tool for " + osArch);
files.symlink(
files.pathJoin(
tmpTropo.linkToLatestMeteor(files.pathJoin(
tmpTropo.packagePath(toolPackage, toolVersion, true),
toolRecord.path,
'meteor'),
files.pathJoin(tmpTropo.root, 'meteor'));
'meteor'));
files.createTarball(
tmpTropo.root,

View File

@@ -434,9 +434,9 @@ _.extend(exports.Tropohouse.prototype, {
return files.readlink(linkPath);
},
replaceLatestMeteorSymlink: function (linkText) {
linkToLatestMeteor: function (scriptLocation) {
var self = this;
var linkPath = files.pathJoin(self.root, 'meteor');
files.symlinkOverSync(linkText, linkPath);
files.symlinkOverSync(scriptLocation, linkPath);
}
});

View File

@@ -197,7 +197,7 @@ var updateMeteorToolSymlink = function () {
if (!toolRecord)
throw Error("latest release has no tool?");
tropohouse.default.replaceLatestMeteorSymlink(
files.pathJoin(relativeToolPath, toolRecord.path, 'meteor'));
tropohouse.default.linkToLatestMeteor(files.pathJoin(
relativeToolPath, toolRecord.path, 'meteor'));
}
};