Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #454 from lordgreg/bugfix/gulp_resources_windows_os
Browse files Browse the repository at this point in the history
Fix for Windows OS incompatibility when copying resources
  • Loading branch information
gruppjo authored Dec 7, 2016
2 parents 59d95c6 + 8a81e64 commit eefc3a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion generators/app/templates/gulp/cordova.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ gulp.task('clean-res', function () {
return gulp.src('res/*/current/*')
.pipe(vinylPaths(del));
});

gulp.task('resources', ['clean-res'], function () {
var setFolder = options.res || 'default';
var slash = '/';

var resourceFiles = 'res/*/' + setFolder + '/**/*';
return gulp.src(resourceFiles)
.pipe($.rename(function (path) {
path.dirname = path.dirname.replace('/' + setFolder, '/current');
if (path.dirname.search(/\\/ig) > -1) {
slash = '\\';
}
path.dirname = path.dirname.replace(slash + setFolder, slash + 'current');
}))
.pipe(gulp.dest('res'));
});
Expand Down

0 comments on commit eefc3a7

Please sign in to comment.