labnol / apps-script-starter

Setup a local development environment inside Visual Studio Code and build Google Workspace add-ons with Google Apps Script
https://www.youtube.com/watch?v=KxdCIbeO4Uk
MIT License
1.1k stars 176 forks source link

clasp create command doesn't create .clasp.json file #69

Closed FerEnoch closed 1 year ago

FerEnoch commented 1 year ago

Hello Sr. I don't know for sure if this is a bug, but opened this issue in order to report that when running the npx clasp create command, the .clasp.json file is not created in the root folder, as said in your blog.

As illustration: $~ npx clasp create --type sheets --title "my_sheets" --rootDir ./dist -> Created new Google Sheet: https://drive.google.com/open?id=11Q... -> Created new Google Sheets Add-on script: https://script.google.com/d/123... -> "ENOENT: no such file or directory, open 'dist/.clasp.json'"

I had to manually add the .clasp.json file into the root folder after the dist folder were created with npm run build, and it worked, but I think this would not be the expected behaviour.

Thanks in advance for your time and for this amazing bootstrapping for us newies in apps script.

BryanWall commented 1 year ago

Maybe the same issue reported here?

https://github.com/labnol/apps-script-starter/issues/19#issuecomment-1175469909

FerEnoch commented 1 year ago

Thanks @BryanWall , I've read it, and I think it's quite different, or anyway there's a different solution in this case: you have to add the .clasp.json file alfer run the build command, so clasp can find the dist folder to upload.

Or, which is the same: $~ npx clasp create --type sheets --title "my_sheets" --rootDir ./

Then build, and after that, modify the .clasp.json "rootDir" property to "./dist"