run a sequence of bash commands as specified by a json
npm install bash-fool
[//]: # ( ns__file unit: standard, comp: README.md )
[//]: # ( ns__custom_start beginning )
[//]: # ( ns__custom_end beginning )
[//]: # ( ns__start_section intro )
[//]: # ( ns__custom_start description )

run a sequence of bash commands as specified by a json
[//]: # ( ns__custom_end description )
[//]: # ( ns__custom_start afterDescription )
[//]: # ( ns__custom_end afterDescription )
[//]: # ( ns__custom_start badges )
[//]: # ( ns__start_section usageSection )






[//]: # ( ns__custom_end badges )
[//]: # ( ns__end_section intro )
[//]: # ( ns__start_section api )
[//]: # ( ns__custom_start Usage )
$codeDir placeholder, it will be dynamically replaced by targetDir. keyName into session, and then you can use it by placing into a command specification that string __session.keyName__. For instance, __session.lastName__ could be used in a command, and session could be {lastName: 'jones'}.Usage
First, install the package:
`
npm i bash-fool
`
Here is a sample usage:
`
const bashFool = require('bash-fool')const commands = [
{
'title': 'echo a string',
'file': 'echo',
'arguments': [
'this is echoed: __session:echoedString',
],
},
{
title: 'more nothing',
file: 'echo',
arguments: [
'second echoed function',
],
},
]
const echoedString = 'foobar'
const session = { echoedString }
const targetDir = 'nonexistent'
(async () => {
let listr = await bashFool(commands, targetDir, session)
await listr.run()
// will echo:
this is echoed: foobar
// and then: second echoed function
})()
``[//]: # ( ns__custom_end Usage )
[//]: # ( ns__custom_start APIIntro )
[//]: # ( ns__custom_end APIIntro )
[//]: # ( ns__custom_start constantsIntro )
[//]: # ( ns__custom_end constantsIntro )
[//]: # ( ns__start_section types )
[//]: # ( ns__end_section types )
[//]: # ( ns__end_section api )