Edit your .clasp.json and set the "fileExtension" property to "gs". That will prevent clasp from renaming your "gs" to "js". Then in your .clasp.ignore file you can specify the files and folders you want to ignore.
--
Warning: The new content replaces all existing files in the script project. Files not updated by the request are removed. |
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/CAK957HxdQuUanst_OatTdG0xK_oc1%3D9Ve9WQrGzm74c6k2STWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Note: When updating script project content, common practice is to first issue a projects.getContent request to retrieve an array of the existingFile
s, make the desire [changes] to those objects, then use theFile
s as input for a projects.updateContent request.
* TODO: Only push the specific files that changed (rather than all files).
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/08b4cf0a-6865-4ebc-8893-3a62ac27a42d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
That looks to be on the todo list. From the push command source file:* TODO: Only push the specific files that changed (rather than all files).On Wed, Jun 12, 2019 at 12:53 PM Faustino Rodriguez <fau...@thexs.ca> wrote:Thanks a lot Steven for your feedback, the link, the warning and the detailed explanationsYou are right, it is quite risky to edit in both places, unless as an exceptionLooking at that page, I was hoping that clasp would follow what it says right above that Warning (quote below, bold and [] are mine), but it's not the case unfortunatelyNote: When updating script project content, common practice is to first issue a projects.getContent request to retrieve an array of the existingFile
s, make the desire [changes] to those objects, then use theFile
s as input for a projects.updateContent request.
I looked around at the code in GitHub, and it seems feasible to do a push/pull of only the changes in either wayOr at least do not remove the ignored files in a clasp pushWould that be a possibility in the future?Thanks again
On Wednesday, June 12, 2019 at 3:23:54 PM UTC-4, Steven Bazyl wrote:The underlying API clasp uses doesn't allow partial overwrites of a project. What you're trying to do isn't currently possible.See https://developers.google.com/apps-script/api/how-tos/manage-projects, particularly the warning:
Warning: The new content replaces all existing files in the script project. Files not updated by the request are removed.
You can sort of make it work but would need to be extremely careful about syncing in the correct direction whenever you make a change. That is, after every edit is apps script, do a clasp pull to update your local project. Likewise, after a local edit, do a clasp push. But it's dangerous and risks overwriting changes if not carefully done.When using clasp you're best off having a single source of truth (typically your local environment, since that's the point of clasp :) rather than trying to edit in both places. Of course there are plenty of times I'll edit files in the Apps Script IDE while experimenting or debugging, but anything I plan to keep in those cases I'll reapply locally before pushing.