question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to copy files into different folders within one task?

See original GitHub issue

My case was done by Grunt as following:

copy: {
            dev: {
                files: [{
                    expand: true,
                    cwd: 'bower_components/',
                    src: ['underscore/underscore.js', 'jquery/jquery.js', 'angular/angular.js', 'angular-route/angular-route.js', 'ng-grid/ng-grid-2.0.8.debug.js'],
                    dest: 'build/libs/',
                    flatten: true
                }, {
                    expand: true,
                    cwd: 'bower_components/',
                    src: ['ng-grid/ng-grid.css', 'jquery.ui/themes/base/jquery.ui.theme.css'],
                    dest: 'build/css/',
                    flatten: true
                }, {
                    expand: true,
                    cwd: 'bower_components/jquery.ui/themes/base/',
                    src: ['images/*'],
                    dest: 'build/css/'
                }]
            }
        }

I am wondering if it is possible to do the same thing with Gulp? Cause i like the gulp’s streaming style, but no idea how to do it?

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Reactions:8
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

86reactions
yocontracommented, Feb 19, 2020

It’s as simple as

gulp.src(['your','source','files'])
  .pipe(gulp.dest('output folder'))

Please keep questions to StackOverflow

46reactions
appleboycommented, Feb 19, 2020

Try the following copy task using gulp copy command.

gulp.task('copy', function() {
    gulp.src(['underscore/underscore.js', 'jquery/jquery.js', 'angular/angular.js', 'angular-route/angular-route.js', 'ng-grid/ng-grid-2.0.8.debug.js'])
        .pipe(gulp.dest('build/libs/'))
    gulp.src(['ng-grid/ng-grid.css', 'jquery.ui/themes/base/jquery.ui.theme.css'])
        .pipe(gulp.dest('build/css/'))
    gulp.src('images/**/*')
        .pipe(gulp.dest('build/css/'))
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Create Scheduled Task to Copy Files to Another Folder?
With robocopy and Task Scheduler, you can create a scheduled task to copy files to another folder on regular basis.
Read more >
How to Copy Files from Multiple Subfolders to a Single Folder?
Select all files in the list, and click the Copy button ( F5 ) at the bottom. To move the files, click the...
Read more >
Move or copy an item to another folder - Microsoft Support
Move or copy an item to another folder ; Move using drag and drop. Select the item you want to move. ; Copy...
Read more >
Copy files & folders from multiple folders and paste them all at ...
Go to the destination folder, right-click inside the folder and select Copywhiz–>Paste. All the selected files from different folders will be  ...
Read more >
The Ultimate Guide to Copying Files and Folders Using Xcopy
In this guide, you will learn how to use Xcopy for various file copy scenarios. From copying a single file, multiple directories, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found