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

Attempt to concatenate local 'package_version' (a nil value) #991

Closed
leocavalcante opened this issue Jun 10, 2016 · 5 comments
Closed

Attempt to concatenate local 'package_version' (a nil value) #991

leocavalcante opened this issue Jun 10, 2016 · 5 comments

Comments

@leocavalcante
Copy link

It assumes that every package.json file has a version prop, 'cause that's the default behavior of npm init I guess, but this isn't true for Meteor projects.
Meteor's flaw I would say, but I thought it would be nice to issue that.

C:\cmder/vendor/clink-completions/npm_prompt.lua:11: attempt to concatenate local 'package_version' (a nil value)
C:\apache\htdocs\hello-meteor-1.3 {git}{hg}
{lamb}

Ps.: just ignore my workspace 😆

@DamnedScholar
Copy link

Not having specific version numbers is normal for documentation and web sites, like the Atom Flight Manual.

I'm too much of a Lua noob to fix this. Apparently neither setting a default value for local package_version, nor checking for it after the string.match() attempt is capable of overcoming the bug. I tried

if not package_version then
    local package_version = "unknown"
end

and

if package_version == nil then
    local package_version = "unknown"
end

@leocavalcante
Copy link
Author

leocavalcante commented Jun 14, 2016

Not a Lua expert also, but it seams that using local makes the variable available only on the scope and maybe if blocks are scoped. Not using local to mutate package_version works here:

if package_version == nil then
    package_version = '0.0.0'
end

@leocavalcante
Copy link
Author

leocavalcante commented Jun 14, 2016

In fact, it seams that it is just a matter of updating the dependency:
https://github.com/vladimir-kotikov/clink-completions/blob/master/npm.lua#L212

@vladimir-kotikov, we are missing bumps to 0.3.x 😆

@leocavalcante
Copy link
Author

Sorry, just saw it at dev branch. Nice!

@vladimir-kotikov
Copy link
Contributor

vladimir-kotikov commented Jun 14, 2016

⬆️ 0.3.1 ;-)

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

No branches or pull requests

3 participants