Skip to content

Commit

Permalink
fix(init): set default filename
Browse files Browse the repository at this point in the history
Since d4a06f2, the config file is set only if it exists, but `karma init` requires the filename to be set. This sets the filename to `karma.conf.js` if not present.

Closes #680
Closes #681
  • Loading branch information
vojtajina committed Aug 6, 2013
1 parent 06532b7 commit 34d49b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ exports.init = function(config) {

sm.process(questions, function(answers) {
var cwd = process.cwd();
var configFile = config.configFile;
var configFile = config.configFile || 'karma.conf.js';
var templateFile = isCoffeeFile(configFile) ? COFFEE_TPL_PATH : JS_TPL_PATH;
var replacements = getReplacementsFromAnswers(answers, getBasePath(configFile, process.cwd()));
var content = fs.readFileSync(templateFile).toString().replace(/%(.*)%/g, function(a, key) {
Expand Down

0 comments on commit 34d49b1

Please sign in to comment.