Created
August 5, 2014 21:50
-
-
Save naganowl/a3f282aa1bae7519d4fd to your computer and use it in GitHub Desktop.
Move files into a new location, discarding it's previous file hierarchy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (grunt) -> | |
# Requires a `renameBase` property in task config options. | |
flattenPath = (dest, src) -> | |
path = grunt.task.current.data.renameBase | |
# Make files sibling to those in `renameBase`. | |
if src.indexOf(path) is 0 | |
dest + src.slice path.length | |
else | |
dest + src | |
grunt.initConfig | |
copy: | |
assets: | |
files: [ | |
# Fonts, images, etc. | |
expand: yes | |
src: 'app/assets/**' | |
dest: 'public/' | |
renameBase: 'app/assets' | |
rename: flattenPath | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment