Skip to content

Commit

Permalink
moving things around to fit the packaging style better
Browse files Browse the repository at this point in the history
  • Loading branch information
dangoor committed Apr 17, 2009
1 parent f9f5d3a commit 61ca7db
Show file tree
Hide file tree
Showing 22 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/getjs.js → bin/getjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env narwhal

var cwd = require("file").cwd;

var currentPaths = require.loader.getPaths();
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions src/getjs/install.js → lib/getjs/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports.Installer = function(env) {
exports.Installer.prototype = {
dontinstall: /^\.getjs/,

install: function(name) {
download: function(name) {
var repoLocations = this.env.getRepositories();
var repos = [];
repoLocations.forEach(function(rl) {
Expand All @@ -31,12 +31,16 @@ exports.Installer.prototype = {
break;
}
}

if (!pack) {
throw new GetJSError("Could not locate package " + name
+ " in any repository");
}

return {pack: pack, packFile: packFile, sourceFile: sourceFile};
},

install: function(pack, packFile, sourceFile) {

this._installPackage(pack, packFile);

this.env.addPackage(sourceFile, pack);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion src/getjs/repo.js → lib/getjs/repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ exports.Repository.prototype = {
destination.mkdirs();
}
var destFile = destination.join(pack['filename']);
destFile.write(sourceFile.read());
if (destFile != sourceFile) {
destFile.write(sourceFile.read());
}
return destFile;
}
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ testing.run({
env.clearRepositories();
env.addRepository("getjs/tests/packages/index.json");
var installer = new install.Installer(env);
installer.install("skewer");
var downloadinfo = installer.download("skewer");
installer.install(downloadinfo.pack,
downloadinfo.packFile,
downloadinfo.sourceFile);

var packfile = testdata.join("build", "Skewer-0.6.jspkg");
testing.truthy(packfile.exists(), "build/Skewer-0.6.jspkg should exist");
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 61ca7db

Please sign in to comment.