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

Fails on non-standard path characters #616

Closed
dustinboss opened this issue Aug 5, 2014 · 9 comments
Closed

Fails on non-standard path characters #616

dustinboss opened this issue Aug 5, 2014 · 9 comments
Labels

Comments

@dustinboss
Copy link

I beat my head against a wall for HOURS on this issue. I'm not sure if it's core to Gulp or just the way that the packages are handles, but hopefully this can help someone.

I had a path that contained bracket characters, like: "~/Desktop/[gulp]"

When I cd to the directory, it worked fine
cd ~/Desktop/[gulp]/", it worked fine

When I ran "gulp scripts" it SEEMED to work fine
Using gulpfile ~/Desktop/[gulp]/gulpfile.js
Starting 'scripts'...
Finished 'scripts' after 7.53 ms

But... nothing happened. No errors, no output... nothing.

I tried with many packages, and I couldn't get any of the "hello world" examples to work (jshint, gulp-concat, etc)

Finally, I moved the whole thing to a new directory without the characters, and it worked fine!

At any rate, the "[" and "]" characters seems to silently break the process.

@AntouanK
Copy link
Contributor

AntouanK commented Aug 5, 2014

@hsubu maybe the [ ] break the regexp pattern in glob or something? ( the way gulp reads paths to load files )

@dustinboss
Copy link
Author

Thanks. I figure it's something like that. Probably some loader that could be escaping the characters.

In my case, I just renamed the directory. A small price to pay for realizing that I was still smart enough to handle "Hello World" tutorials.

@yocontra
Copy link
Member

yocontra commented Aug 5, 2014

gulpfile, gulp version, and OS please

@yocontra
Copy link
Member

yocontra commented Sep 1, 2014

Somebody opened an issue on minimatch for this, can somebody link it?

@yocontra
Copy link
Member

yocontra commented Sep 1, 2014

isaacs/minimatch#50

@holographix
Copy link

I just lost the entire morning working out a problem with gulp, just to later discover that it was related to the fact the my path was containing a nice pair of square brackets. damn't!

[ FYI ]

The incriminated path was "/Users/aaron/Works/The new App/repo [GIT]/"
I'm using

ionic 1.0.1
ionic-cli 1.6.4
gulp 3.9.0
sass 3.4.15
node 0.12.7
running on OSX Yosemite

here is comes the gulp file

  var gulp = require('gulp');
  var gutil = require('gulp-util');
  var bower = require('bower');
  var concat = require('gulp-concat');
  var sass = require('gulp-sass');
  var minifyCss = require('gulp-minify-css');
  var rename = require('gulp-rename');
  var sh = require('shelljs');

  var paths = {
    sass: ['./scss/**/*.scss']
  };

  gulp.task('default', ['sass']);

  gulp.task('sass', function(done) {
    gulp.src('./scss/ionic.app.scss')
      .pipe(sass({
        errLogToConsole: true
      }))
      .pipe(gulp.dest('./www/css/'))
      .pipe(minifyCss({
        keepSpecialComments: 0
      }))
      .pipe(rename({ extname: '.min.css' }))
      .pipe(gulp.dest('./www/css/'))
      .on('end', done);
  });

  gulp.task('watch', function() {
    gulp.watch(paths.sass, ['sass']);
  });

  gulp.task('install', ['git-check'], function() {
    return bower.commands.install()
      .on('log', function(data) {
        gutil.log('bower', gutil.colors.cyan(data.id), data.message);
      });
  });

  gulp.task('git-check', function(done) {
    if (!sh.which('git')) {
      console.log(
        '  ' + gutil.colors.red('Git is not installed.'),
        '\n  Git, the version control system, is required to download Ionic.',
        '\n  Download git here:', gutil.colors.cyan('http://git-scm.com/downloads') + '.',
        '\n  Once git is installed, run \'' + gutil.colors.cyan('gulp install') + '\' again.'
      );
      process.exit(1);
    }
    done();
  });

It would be really nice to see those kind of annoying bugs go away for good in the next iteration.

@phated
Copy link
Member

phated commented Aug 5, 2015

@holographix posting here isn't helpful, you need to comment on the linked minimatch issue, as it doesn't get any responses from the library author.

@yocontra
Copy link
Member

yocontra commented Aug 5, 2015

Again, if you are having trouble please post about it on the minimatch issue - this is not our bug to solve,.

@phated
Copy link
Member

phated commented Apr 5, 2016

We've switched to micromatch in gulp 4. Hoping this is fixed over there. If not, an issue needs to be created for them. /cc @es128 @jonschlinkert

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

No branches or pull requests

5 participants