git-ishow
Version:
Git plugin that lets you interactively select a stashed item to show
17 lines (13 loc) • 515 B
JavaScript
const { join } = require('path');
const { exec, spawn } = require('child_process');
const env = {
...process.env,
PATH: process.env.PATH + ':' + join(__dirname, 'node_modules', '.bin')
};
exec('git stash list | ipt -M "Select stashed item to show:" --unquoted | cut -d ":" -f 1', { env }, (err, stdout, stderr) => {
if (err) {
return console.error(err);
}
spawn('git', ['stash', 'show', '-u', stdout.trim()], { env, stdio: ['inherit', 'inherit', 'inherit']});
});