Last active
April 19, 2019 22:17
-
-
Save vaxinate/afabc6c4a2711497f7000c62c70a691f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{"project":"Hosting Platform","date":"01/10/2019","category":"DevOps","hours":"2.5"}, | |
{"project":"Hosting Platform","date":"01/12/2019","category":"DevOps","hours":"3"} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env node | |
// usage: | |
// punchtabs "Adam Clarke" "/Users/adam/.punches.json" | |
const util = require('util') | |
const {execSync} = require('child_process') | |
const args = process.argv.slice(2) | |
const name = args[0] | |
const punches = require(args[1]) | |
const openTab = (punch) => { | |
const { project, date, hours, category } = punch | |
const url = `https://airtable.com/shrV4tXD46VGk42JM?prefill_Name=${name}&prefill_Project=${project}&prefill_Category=${category}&prefill_Date=${date}&prefill_Hours=${hours}` | |
console.log(execSync(`open '${url}'`)) | |
} | |
punches.forEach(openTab) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment