SamVerschueren / gulp-cordova-version

Sets the version in the config.xml of the cordova project.
MIT License
2 stars 4 forks source link

path is undefined #11

Closed sekar-worx closed 7 years ago

sekar-worx commented 7 years ago

In gulp-cordova-version module returns path undefined issue in profile.path code. I fixed it temporary by using var profile = { path: '' }. Please fix this.

SamVerschueren commented 7 years ago

Could you copy paste the exact error and stack trace?

SamVerschueren commented 7 years ago

Or better, your gulp file. I think you misconfigured it.

sekar-worx commented 7 years ago

Hey Sam, Thanks for reply. I just copied the gulp file code which is you provided in readme.md file. In this in gulp-cordova-version through function code is not calling. Only the through callback only works. I think the project variable is not initialised.

The stack trace is

[12:37:58] Using gulpfile ~/ghs/gulpfile.js [12:37:58] Starting 'build'... [12:37:58] 'build' errored after 17 ms [12:37:58] Error in plugin 'gulp-cordova-version' Message: Cannot read property 'path' of undefined

SamVerschueren commented 7 years ago

So you did this?

var gulp = require('gulp'),
    create = require('gulp-cordova-create'),
    version = require('gulp-cordova-version');

gulp.task('build', function() {
    return gulp.src('dist')
        .pipe(create())
        .pipe(version('2.3.1'));
});

Does the dist directory exist?

sekar-worx commented 7 years ago

Yes, I did the same thing. No dist is not exist.

SamVerschueren commented 7 years ago

That's the problem. dist is the directory with all the files that you want to package as cordova application. I agree that the error message should be more descriptive so I will leave this open and change the title.

SamVerschueren commented 7 years ago

Aha, already have an issue for this right here. So closing this one.

sekar-worx commented 7 years ago

Hi Sam, Can you please provide sample folder structure app ?

SamVerschueren commented 7 years ago
project
  |- gulpfile.js
  |- dist
       |- index.html
       |- app.js

Something like this

sekar-worx commented 7 years ago

Hi Sam, Thanks for reply. I used same structure like you mentioned. But it is not updating config.xml. It is only show response like this

gulp build [14:00:29] Using gulpfile ~/gulpfile.js [14:00:29] Starting 'build'...

sekar-worx commented 7 years ago

Hi Sam, Now i am fixed it and it's working. Thank you.