|
1 | 1 | "use strict"; |
2 | 2 |
|
3 | | -var config = require("../config"); |
4 | | -var utils = require("../utils"); |
5 | | -var logger = require("../logger").logger; |
| 3 | +var config = require("../config"); |
| 4 | +var logger = require("../logger").logger; |
6 | 5 |
|
7 | | -var fs = require("fs"); |
8 | | -var _ = require("lodash"); |
9 | | -var path = require("path"); |
| 6 | +var fs = require("fs"); |
| 7 | +var _ = require("lodash"); |
| 8 | +var path = require("path"); |
10 | 9 |
|
11 | 10 | var info = { |
12 | 11 | /** |
@@ -44,13 +43,10 @@ var info = { |
44 | 43 | }); |
45 | 44 |
|
46 | 45 | var file = fs.readFileSync(path.join(__dirname, config.template), "utf8"); |
47 | | - |
48 | 46 | file = file.replace("//OPTS", JSON.stringify(userOpts, null, 4)); |
49 | 47 |
|
50 | | - var filePath = cwd + config.userFile; |
51 | | - |
52 | | - fs.writeFile(filePath, file, function () { |
53 | | - logger.info("Config file created {magenta:%s}", utils.resolveRelativeFilePath(filePath, cwd)); |
| 48 | + fs.writeFile(path.resolve(cwd, config.userFile), file, function () { |
| 49 | + logger.info("Config file created {magenta:%s}", config.userFile); |
54 | 50 | logger.info( |
55 | 51 | "To use it, in the same directory run: " + |
56 | 52 | "{cyan:browser-sync start --config bs-config.js}" |
|
0 commit comments