import Git from 'simple-git'; async function check_workspace_clean() { return Git().status().then( (result) => { if(!result.isClean()) throw new Error('workspace not clean, aborting'); }) } export default async () => { await check_workspace_clean(); console.log( 'yay'); }