Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
benallfree committed Apr 27, 2024
1 parent aa49977 commit f214784
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions plop/commands/testCommand.ts
Expand Up @@ -61,6 +61,8 @@ export function testCommand(plop: NodePlopAPI) {

const appHelperPath = join(appPath, `helper`)

const tgz = globSync(`gobot-*.tgz`, { cwd: appHelperPath })[0]

const { bot } = await getBot(slug)

const shouldRun = async () =>
Expand Down Expand Up @@ -169,20 +171,11 @@ export function testCommand(plop: NodePlopAPI) {
async (answers, config, plop) => {
if (!(await shouldRun()))
return `${slug} is not available for platform. Skipping gobot exec`
return exec(`gobot ${slug} ${args.join(',')}`)(
answers,
config,
plop,
)
},
async (answers, config, plop) => {
const tgz = globSync(`gobot-*.tgz`, { cwd: appHelperPath })[0]
return exec(`npm i -g ${tgz}`, { cwd: appHelperPath })(
answers,
config,
plop,
)
await exec(`npm i -g gobot`)(answers, config, plop)
await exec(`gobot ${slug} ${args.join(',')}`)(answers, config, plop)
return `${slug} run successful`
},
exec(`npm i -g ${tgz}`, { cwd: appHelperPath }),
async (answers, config, plop) => {
if (!(await shouldRun()))
return `${slug} is not available for platform. Skipping tgz bin alias exec`
Expand All @@ -191,7 +184,6 @@ export function testCommand(plop: NodePlopAPI) {
exec(`npm rm -g gobot-${slug.toLocaleLowerCase()}`, {
cwd: appHelperPath,
}),
exec(`npm i -g gobot`),
exec(`npm i -g gobot-${slug.toLocaleLowerCase()}`, {
cwd: appHelperPath,
}),
Expand Down

0 comments on commit f214784

Please sign in to comment.