Easy reference for published scripts

Simple list of projects on github posted on 11th Jan 2020


It would be useful to keep a reference guide to all projects and libraries shared on github, and their IDS. If you are using gasgit, then we already have everything needed to make that as part of the workflow.

Here's a link to all of mine. It'll be updated automatically each time there's a change or update to any of my published scripts.

It looks like this

How does it work

gasgit creates an info.json file for all the source code it is managing in each repository. Summarizing these into a spreadsheet can be done like this
function doSheet () {
  // this is the extractor handle
  var extractor = getExtractor();

  
  // get all the info files
  var result  = extractor.getAllTheInfos();
  if (!result.success) {
    throw 'failed to get all the infos ' + JSON.stringify(result);
  }
  var infos = result.data.content;
  writeSummarySpreadsheet ({
    infos: infos,
    id: 'xxxxxxxxxxxxxxxxxxxxxx',
    name: 'list',
    gitRoot: 'https://github.com/brucemcpherson/'
  })
}

function writeSummarySpreadsheet(options) {
  if(!options) return;
  const id = options.id;
  const name = options.name;
  const infos = options.infos;
  const gitRoot = options.gitRoot;
  if(!id || !name || !infos || !gitRoot) {
    throw 'missing options from summary sheet'
  }
  const fiddler = new cUseful.Fiddler(SpreadsheetApp.openById(id).getSheetByName(name));
  fiddler.setData(infos.map(function(f) {
    return {
      name: f.title,
      id: f.id,
      created: new Date(f.createdDate),
      modified: new Date(f.modifiedDate),
      noticed: new Date(f.noticed),
      github: gitRoot + f.title,
      modules: f.modules.map(function(g) {
        return g.name;
      }).join(',')
    };
  })).dumpValues();
  
}

This is already in the latest version of gasgit, to grab that , (remember to keep your own settings), update the sheet id and sheetname to one of your own, and you're good to go.



Since G+ is closed, you can now star and follow post announcements and discussions on github, here 

Learning Apps Script, (and transitioning from VBA) are covered comprehensively in my my book, Going Gas - from VBA to Apps script, All formats are available from O'ReillyAmazon and all good bookshops. You can also read a preview on O'Reilly

If you prefer Video style learning I also have two courses available. also published by O'Reilly.
Google Apps Script for Developers and Google Apps Script for Beginners.

Comments