Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync just files from directory, not directory itself #52

Open
FNGR2911 opened this issue Jan 19, 2018 · 3 comments
Open

Sync just files from directory, not directory itself #52

FNGR2911 opened this issue Jan 19, 2018 · 3 comments

Comments

@FNGR2911
Copy link

Hi everybody! Maybe I'm too stupid to read the docs, but is it possible to rsync just the files from a directory 'dist/.' to a destination without the directory itself? I don't need the 'dist' folder on my server.

Thank you :)

@ghost
Copy link

ghost commented Nov 19, 2018

Hello, don't know if you worked this out, but I did this which worked:

Say I have a dist folder like this:

dist/app-name

I passed the following to gulp.src:

['**/.', 'app-name']

after changing diretory to dist/app-name like so:

process.chdir('dist/app-name')

So the full code is (given dist/app-name):

process.chdir('dist/app-name')
return gulp.src(['**/.', 'app-name'])
        .pipe(rsync(rsyncConf));

NB: the period in the match path ensures things like .htaccess are included

HTH

@ghost
Copy link

ghost commented Nov 19, 2018

@FNGR2911 see my previous comment but also forgot to add that regarding .htaccess, this needs to be added to angular.json like:


            "assets": [
              "src/favicon.ico",
              "src/.htaccess",
              "src/assets"
            ],

@diegomarcuz
Copy link

@FNGR2911 Hello, I don't know if could solve your issue, but you need to set root property with the value of dist, so the dist content will be published under the destination.

Example:

   src('dist/**').pipe(rsync({
     root: 'dist',
   }))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants