Cmder: Attempt to concatenate local 'package_version' (a nil value)

Created on 10 Jun 2016  路  5Comments  路  Source: cmderdev/cmder

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 :laughing:

Most helpful comment

:arrow_up: 0.3.1 ;-)

All 5 comments

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

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

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 :laughing:

Sorry, just saw it at dev branch. Nice!

:arrow_up: 0.3.1 ;-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hyrious picture hyrious  路  3Comments

Joe1992w picture Joe1992w  路  3Comments

tfarina picture tfarina  路  3Comments

danwellman picture danwellman  路  3Comments

luisrudge picture luisrudge  路  3Comments