Skip to content

Commit

Permalink
chore(refactor): prefer path.resolve (angular#3751)
Browse files Browse the repository at this point in the history
`path.join` does not account for absolute paths like `path.resolve` does.  This
is not a problem in this case but could be in the future
  • Loading branch information
sjelin authored Nov 18, 2016
1 parent 40eb493 commit 70bc6ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if (argv.help) {
}

if (argv.version) {
console.log('Version ' + require(path.join(__dirname, '../package.json')).version);
console.log('Version ' + require(path.resolve(__dirname, '../package.json')).version);
process.exit(0);
}

Expand Down
4 changes: 2 additions & 2 deletions testapp/scripts/web-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ var env = require('../../spec/environment.js');
var testApp = express();
var DEFAULT_PORT = process.env.HTTP_PORT || env.webServerDefaultPort;
var testAppDir = path.resolve(__dirname, '..');
var defaultAngular = require(path.join(testAppDir, 'ng1/lib/angular_version.js'));
var defaultAngular = require(path.resolve(testAppDir, 'ng1/lib/angular_version.js'));

var argv = optimist.describe('port', 'port').
default('port', DEFAULT_PORT).
describe('ngversion', 'version of AngularJS to use').
default('ngversion', defaultAngular).
argv;

var angularDir = path.join(testAppDir, 'ng1/lib/angular_v' + argv.ngversion);
var angularDir = path.resolve(testAppDir, 'ng1/lib/angular_v' + argv.ngversion);

var main = function() {
var port = argv.port;
Expand Down

0 comments on commit 70bc6ea

Please sign in to comment.