Skip to content

Commit

Permalink
fix(utils): remove useless resolveRelativeFilePath method
Browse files Browse the repository at this point in the history
  • Loading branch information
shinnn committed May 5, 2015
1 parent aef3fc8 commit 4b6c281
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
18 changes: 7 additions & 11 deletions lib/cli/cli-info.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
"use strict";

var config = require("../config");
var utils = require("../utils");
var logger = require("../logger").logger;
var config = require("../config");
var logger = require("../logger").logger;

var fs = require("fs");
var _ = require("lodash");
var path = require("path");
var fs = require("fs");
var _ = require("lodash");
var path = require("path");

var info = {
/**
Expand Down Expand Up @@ -44,13 +43,10 @@ var info = {
});

var file = fs.readFileSync(path.join(__dirname, config.template), "utf8");

file = file.replace("//OPTS", JSON.stringify(userOpts, null, 4));

var filePath = cwd + config.userFile;

fs.writeFile(filePath, file, function () {
logger.info("Config file created {magenta:%s}", utils.resolveRelativeFilePath(filePath, cwd));
fs.writeFile(path.resolve(cwd, config.userFile), file, function () {
logger.info("Config file created {magenta:%s}", config.userFile);
logger.info(
"To use it, in the same directory run: " +
"{cyan:browser-sync start --config bs-config.js}"
Expand Down
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
},
socketIoScript: "/public/socket.io.js",
configFile: "default-config.js",
userFile: "/bs-config.js",
userFile: "bs-config.js",
template: "cli-template.js",
httpProtocol: {
path: "/__browser_sync__"
Expand Down
3 changes: 1 addition & 2 deletions lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ module.exports.callbacks = {
return logger.info("{cyan:Reloading files that match: {magenta:%s", data.path);
}

var path = utils.resolveRelativeFilePath(data.path, data.cwd);
logger.info("{cyan:File changed: {magenta:%s", path);
logger.info("{cyan:File changed: {magenta:%s", data.path);
}
},
/**
Expand Down
8 changes: 0 additions & 8 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,6 @@ var utils = {
getUaString: function (ua) {
return parser.setUA(ua).getBrowser();
},
/**
* @param {String} filepath
* @param {String} cwd
* @returns {String}
*/
resolveRelativeFilePath: function (filepath, cwd) {
return filepath.replace(cwd + "/", "");
},
/**
* Open the page in browser
* @param {String} url
Expand Down

4 comments on commit 4b6c281

@shinnn
Copy link
Contributor Author

@shinnn shinnn commented on 4b6c281 May 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

io.js build is failing, because io.js is now v2.0.0 and node-gyp doesn't seem to support it. nodejs/node-gyp#564

@shinnn
Copy link
Contributor Author

@shinnn shinnn commented on 4b6c281 May 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now we have these options:

@shakyShane
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow_failures seems the best temporary solution, let's go with that :)

@shinnn
Copy link
Contributor Author

@shinnn shinnn commented on 4b6c281 May 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.