Skip to content

Conversation

@juggledad
Copy link
Contributor

  • Documentation update
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

Updated the README.md to expand on the 'Example 2' description of how to save the function node

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the mailing list/slack team.
  • I have run grunt to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@coveralls
Copy link

Coverage Status

Coverage remained the same at 65.295% when pulling 98d112e on juggledad:patch-1 into 94038f5 on node-red:master.

@dceejay dceejay merged commit 5381eff into node-red:master Feb 24, 2020
@dceejay
Copy link
Member

dceejay commented Feb 24, 2020

Thanks -

from the forum discussion - should it also include the -n ... name parameter in the command to ensure it works ? or does it pick up the name correctly ?

@juggledad
Copy link
Contributor Author

As long as the 'Name' in the function node is filled in, it picks up that name for the final node name regardless of the name you save the file as. So If I called my function 'pauls function' and saved it as 'test.js', when you run the node-red-nodegen you end up with 'node-red-contrib-pauls-function'.

If you leave the function's `name' option blank, you end up with 'node-red-contrib-unnamed-function'

In all case, if you use the '--name' option, like '--name fubar' you end up with node-red-contrib-fubar

@juggledad
Copy link
Contributor Author

One oddity that I notice. In the function node - export item dropdown - 'Save to Library' is shows

Library -> function -> yourname.js

but if you go look at the actual file path, the folder is functions (note it is plural).
The example shows the command to be:

node-red-nodegen ~/.node-red/lib/function/lower-case.js

which fails because the path needs it to use functions (plural) so somewhere it needs to change

@kazuhitoyokoi
Copy link
Member

@juggledad Thank you for the notice. It was just typo which I created. I fixed it in the commit, 9c761fe.

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.

4 participants