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

Use semver to define which version to load (fix #108) #109

Closed
wants to merge 2 commits into from

Conversation

yohanboniface
Copy link
Member

Fix #108

This also:

  • dynamically builds the available versions by listing
    the versions directories.
  • introduces module.latest, that point to the latest version
    id available

Using "semver" module, this will also allow much advanced loading
syntax (like ranges, carret, star or x…).

@flippmoke up for a review? :)

This also:

- dynamically builds the available versions by listing
  the versions directories.
- introduces module.latest, that point to the latest version
  id available

Using "semver" module, this will also allow much advanced loading
syntax (like ranges, carret, star or x…).
var getVersions = function () {
var names = fs.readdirSync('./'), versions = [];
for (var i = 0; i < names.length; i++) {
if(names[i].match(/^\d{1,2}\.\d{1,2}\.\d{1,2}$/)) versions.push(names[i]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this trying to figure out if the string is a valid semver? should this use semver.valid in a call to .filter()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

@springmeyer
Copy link
Member

landed in 08437ab

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

Successfully merging this pull request may close these issues.

None yet

3 participants