When managing container-bound scripts across multiple containers, it would be helpful if you are able to push to all of them in one go. This way you can have one project source and trust that all the documents will work the same.
Given the following clasp.json
{
"scriptId": "<root-id>",
"mirrorIds": ["<other-script-id>", "<another-script-id>"]
}
clasp push would push the files to "<other-script-id>" and "<another-script-id>" projects as well as "<root-id>" project.
I've got a rough version of this working, but I figured the exact details would need some discussion and tweaking before submitting a pull request, assuming this is a feature you'd want to support.
I think a better solution would be a bash script push.sh which contains:
clasp setting scriptId <id>
clasp push
clasp setting scriptId <id2>
clasp push
That way, it more customizable, and would solve other problems with creating setting values.
LMK if that works for your use-case.
@arichardsmith
My question is around the workflow and it doesn't touch the code. Did you tried a trigger injection instead code multi copies? You can bind up to 25 sheets for one project.
@oshliaer
My use case needs to use getUi, which as far as I know is only available to container-bound scripts. If there is a way to get around this then I wouldn't need to mirror to multiple scripts, which would be great!
@arichardsmith look at this https://gist.github.com/oshliaer/a1f45e5ae8673dbe55b5074288651695 The main trick is there https://gist.github.com/oshliaer/a1f45e5ae8673dbe55b5074288651695#file-gs_code-gs-L18-L23
@oshliaer
I did not realise that any function triggered by a spreadsheet runs as if it is container bound. That's really helpful!
@grant
Seems like there is a workaround, but if you would still like to add a clasp settings feature I'm happy to finish off working on it.
Adding clasp settings in #350 makes this easy to do now, so closing. Thanks!
Most helpful comment
Adding
clasp settingsin #350 makes this easy to do now, so closing. Thanks!