Skip to content

Instantly share code, notes, and snippets.

@hail2u
Last active August 29, 2015 14:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hail2u/02591628c85951bf7225 to your computer and use it in GitHub Desktop.
Save hail2u/02591628c85951bf7225 to your computer and use it in GitHub Desktop.
Gruntのバグ?

scpを使ってファイルのアップロードを行うGruntタスクがあるとして、このようにタスク定義をすると、grunt upload:cssでエラーになる。Gruntが指定されたタスク設定をパースする時、タスク設定にある他のターゲットの設定もパースするので、CLIオプションに依存するようなターゲットが他にあると(この場合はfileターゲットで使っている--fileオプション)そこでパースが失敗する。

/* jshint node: true */
'use strict';
var path = require('path');
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
upload: {
file: {
dest: path.relative(process.cwd(), grunt.option('file'))
},
css: {
expand: true,
cwd: 'styles/',
src: [
'*.css',
'*.map'
],
dest: 'styles/'
},
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment