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

pdf.js version not set correctly for builds of downloaded sources (non-git repositories) #9834

Closed
qwer1304 opened this issue Jun 22, 2018 · 4 comments

Comments

@qwer1304
Copy link

I finally (I hope) figured out why the version number of pdf.js Chrome extensions built by me didn't have the correct version.
I downloaded the 2.0.550 archive from the releases pages, set up everything as should (npm, gulp, etc) and then tried to build a Chrome extension.
The build is successfull, but the resulting extension has 2.0.0 version.
The problem is that gulpfile.js assumes it's in a git repository to determine the build number (see line 426 and on), but it's not in this case (git gives fatal: Not a git repository (or any of the parent directories): .git)
This wouldn't happen if the directory were obtained using git clone ... in which case it would be a proper git repository.

@timvandermeij
Copy link
Contributor

Indeed, that may well be the case. I don't really think there is anything we can do about that though because the version number is determined by the commits. Only a different versioning scheme could help, but for now that's not really considered.

@qwer1304
Copy link
Author

You could at least put a comment / warning in the README.

@Snuffleupagus
Copy link
Collaborator

Perhaps it would make more sense to just error out, rather than generating a fake buildnumber?

pdf.js/gulpfile.js

Lines 431 to 434 in 34594a5

if (!err) {
// Build number is the number of commits since base version
buildNumber = stdout ? stdout.match(/\n/g).length : 0;
}

@timvandermeij
Copy link
Contributor

I don't really see this as a problem, but if someone wants to contribute a patch for that I'm fine with it. Marking as a good beginner bug.

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

No branches or pull requests

3 participants