How do I copy directories recursively with gulp?

后端 未结 4 1448
旧巷少年郎
旧巷少年郎 2020-12-04 06:44

I am trying to stage a project from a working directory to a server (same machine). Using the following code:

gulp.src([
    \'index.php\',
    \'css/**\',
          


        
4条回答
  •  暖寄归人
    2020-12-04 07:14

    If you want to copy the entire contents of a folder recursively into another folder, you can execute the following windows command from gulp:

    xcopy /path/to/srcfolder /path/to/destfolder /s /e /y
    

    The /y option at the end is to suppress the overwrite confirmation message.

    In Linux, you can execute the following command from gulp:

    cp -R /path/to/srcfolder /path/to/destfolder
    

    you can use gulp-exec or gulp-run plugin to execute system commands from gulp.

    Related Links:

    1. xcopy usage

    2. gulp-exec and gulp-run

提交回复
热议问题