danthareja / node-google-apps-script

[DEPRECATED - use clasp instead] The easiest way to develop Google Apps Script projects
MIT License
353 stars 70 forks source link

gapps upload fails if .html and .js/.gs files collide on either side #50

Open thanatos opened 7 years ago

thanatos commented 7 years ago

First, Apps Script appears to not allow two files differing only in .gs and .html extensions. The Apps Script UI itself handles this really poorly: if you attempt to create a Foo.html, and you already have a Foo.gs, the request to have Foo.html created will silently fail, with no error messages.

gapps upload also fails if you try to upload both a Foo.js and Foo.html; I'm okay lumping this in with all the other "gapps will fail if you do anything unusual" cases that exist. However, if you attempt to upload only a Foo.html file (no Foo.js), but Foo.gs exists in Drive/server side, the request will fail.

Does gapps upload remove files prior to attempting to add news ones? (Is this even how this operation works? Looking at the docs, it wasn't particularly clear if it was.) If not, this could avoid erroring out despite the state that we want to sync being completely valid.

(Also, is it possible to get gapps upload to output any sort of error message about why it fails?)

oshliaer commented 7 years ago

@thanatos The native editor also fails when you add same file names. Without errors. As far as I know, Drive API for Script Files usually returns not 200OK while an error.

lricoy commented 6 years ago

I think we could create some more checks and little by little start adding more advanced ones. From what I can tell the upload command knows little about the reasons of why it the fails but by adding those kinds of pre-checks we could pinpoint it a little better. Or maybe to not delay the push, run then only after the fail if they take too long. What do you guys think?