i am trying to get all scripts from an AppScript project in order to push them to github using Github API.
Any idea on the first part? getting all scripts from a project?
Here are some things i tried
// get content from a script as a string
function getScriptSourceCode() {
const scriptname = "github"
// i don't want to manually write the script name
var content = ScriptApp.getResource(scriptname).getDataAsString();
return content
}
// get AppScript Project
function getSciptsfromProject() {
// Use MimeType enum to log the name of every Google Doc in the user's Drive.
var docs = DriveApp.getFilesByType(MimeType.GOOGLE_APPS_SCRIPT);
var mydoc;
while (docs.hasNext()) {
var doc = docs.next();
if (doc.getName() == "MyAppScriptProject") {
mydoc = doc
}
}
var scriptid = mydoc.getId()
// but how can i get all its scripts?
Logger.log(mydoc)
Logger.log(scriptid)
}