OpenCerts / opencerts-website

Apache License 2.0
21 stars 70 forks source link

The cli tool to add new templates is bugged #284

Closed raulgomezc closed 5 years ago

raulgomezc commented 5 years ago

When running npm run dev-cli, the client hangs like this:

raulgomez@Rauls-MacBook-Pro:~/projects/opencerts-website(SIPMM)$ npm run dev-cli 

> opencerts-website@2.0.0 dev-cli /Users/raulgomez/projects/opencerts-website
> node -r esm ./scripts/cli.js

? Operation? Add a template
? Organisation Domain Name? e.g: moe.edu.sg ex.edu.sg
? Template Name? (this is the value that will be in your certificate file) e.g: 2019-Feb-GovTech-Opencerts-
Associate 2019-May-Ex
? Organisation Domain Name: ex.edu.sg, Template Name: 2019-May-Ex 
 Folder will be created at /Users/raulgomez/projects/opencerts-website/src/components/CertificateTem
plates/tlds/sg/edu/ex/2019-May-Ex Yes
TypeError: item.isDirectory is not a function
    at dirListing.filter.item (/Users/raulgomez/projects/opencerts-website/scripts/addNewTemplate.js:32:41)
    at Array.filter (<anonymous>)
    at getSubDirs (/Users/raulgomez/projects/opencerts-website/scripts/addNewTemplate.js:32:21)
    at generateTldsIndex (/Users/raulgomez/projects/opencerts-website/scripts/addNewTemplate.js:145:19)
    at addNewTemplate (/Users/raulgomez/projects/opencerts-website/scripts/addNewTemplate.js:182:54)
    at inquirer.prompt.then.confirmation (/Users/raulgomez/projects/opencerts-website/scripts/addNewTemplate.js:237:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)
raulgomez@Rauls-MacBook-Pro:~/projects/opencerts-website(SIPMM)$ 
rjchow commented 5 years ago

thanks! will investigate this

sumitnitsurat commented 5 years ago

Can not reproduce the issue in master branch. Can you please sync with master and try again? Also please ensure you have read and write permission in the directory.

MacBook-Pro-de-Sumit:opencerts-website sumitchaudhari$ npm run dev-cli

> opencerts-website@2.0.0 dev-cli /Users/sumitchaudhari/govtech/opencerts-website
> node -r esm ./scripts/cli.js

? Operation? Add a template
? Organisation Domain Name? e.g: moe.edu.sg ex.edu.sg
? Template Name? (this is the value that will be in your certificate file) e.g: 2019-Feb-GovTech-Opencerts-Associate 2019-May-Ex
? Organisation Domain Name: ex.edu.sg, Template Name: 2019-May-Ex 
 Folder will be created at /Users/sumitchaudhari/govtech/opencerts-website/src/components/CertificateTemplates/tlds/sg/edu/ex/2019-
May-Ex Yes
MacBook-Pro-de-Sumit:opencerts-website sumitchaudhari$ 
raulgomezc commented 5 years ago

What version of node are you on?

raulgomezc commented 5 years ago

Fixed, the issue was the node version, maybe adding it to the readme? Closing the issue