Permalink
Browse files

Merge pull request #52 from Stanley/patch-1

Remove hard-coded `staging` target from `mkdirs` task
  • Loading branch information...
2 parents 5b7a705 + 4d7c84f commit 9b0f333144e8d6d6b69d36e5419fa5e436d7f442 @mklabs committed Jul 26, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 tasks/misc.js
View
@@ -1,4 +1,3 @@
-
var fs = require('fs'),
path = require('path'),
utils = require('../').utils,
@@ -14,17 +13,18 @@ module.exports = function(grunt) {
});
grunt.registerMultiTask('mkdirs', 'Prepares the build dirs', function() {
+ var name = this.target;
+
this.requires('clean');
- this.requiresConfig('staging');
+ this.requiresConfig(name);
// store the current working directory, a subset of tasks needs to update
// the grunt.file.setBase accordinly on intermediate/ dir. And we might want
// chdir back to the original one
var base = grunt.config('base') || grunt.option('base') || process.cwd();
grunt.config('base', base);
- var name = this.target,
- target = path.resolve(grunt.config(name)),
+ var target = path.resolve(grunt.config(name)),
source = path.resolve(this.data),
cb = this.async();
@@ -41,7 +41,7 @@ module.exports = function(grunt) {
else grunt.log.ok(source + ' -> ' + target);
// Once copy done, ensure the current working directory is the intermediate one.
- grunt.file.setBase(grunt.config('staging'));
+ grunt.file.setBase(grunt.config(name));
cb(!e);
});
});

0 comments on commit 9b0f333

Please sign in to comment.