I try connect with ssh2 and run script in one line command. /usr/bin/ssh2 --password ${password} -l root ${address} cd ${dir} ; python script.py But directory isn't changed. Why ? I want write with two command. It does only first command (cd) Solved Hello you should use && instead of ; and put command in " example: /usr/bin/ssh2 --password ${password} -l root ${address} "cd ${dir} && python script.py"
Can I use gulp-imagemin plugin with gulp-watch? So, I need to optimize images as soon as they are put into the folder. Here is a part of my gulpfile.js: var gulp = require('gulp'); var imagemin = require('gulp-imagemin'); var pngquant = require('imagemin-pngquant'); gulp.task('default', function() { gulp.watch('dist/images/**', function(event) { gulp.run('images'); }); }); // Image files gulp.task('images', function () { return gulp.src('src/images/*') .pipe(imagemin({ progressive: true, svgoPlugins: [{removeViewBox: false}], use: [pngquant()] })) .pipe(gulp.dest('dist/images')); }); Solved in your watch task, you're watching image changes in 'dist/images/ ' .. you should change that to **'src/images/*' Also in your image task, you're watching only for images directly in the images folder (non recu...