node-google-apps-script icon indicating copy to clipboard operation
node-google-apps-script copied to clipboard

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

Open thanatos opened this issue 9 years ago • 2 comments

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?)

thanatos avatar Jan 13 '17 00:01 thanatos

@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.

oshliaer avatar Jan 13 '17 17:01 oshliaer

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?

lricoy avatar Nov 29 '17 10:11 lricoy