Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
benallfree committed Apr 26, 2024
1 parent f8585b1 commit b933d91
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
- name: Test ${{ matrix.app }}
run: |
pnpm plop test "gobot" --no-progress
pnpm plop test "app-${{ matrix.app }}" --no-progress
pnpm plop test "app:${{ matrix.app }}" --no-progress
2 changes: 1 addition & 1 deletion plop/commands/testCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function testCommand(plop: NodePlopAPI) {
},
}
getSlugsFromFileSystem().forEach((slug) => {
subcommands[`app-${slug}`] = {
subcommands[`app:${slug}`] = {
gen: async () => {
const appPath = join(SRC_APPS_ROOT, slug)

Expand Down
4 changes: 3 additions & 1 deletion plop/commands/util/getBot.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { isFunction } from '@s-libs/micro-dash'
import { existsSync } from 'fs'
import { dirname, join } from 'path'
import { fileURLToPath } from 'url'
import {
Expand All @@ -14,7 +15,8 @@ const __dirname = dirname(__filename)

export async function getBot(appSlug: string, options?: Partial<GobotOptions>) {
const appPath = join(SRC_APPS_ROOT, appSlug)
const module = await import(join(appPath)).catch(console.error)
console.log({ appPath }, existsSync(appPath))
const module = await import(appPath).catch(console.error)
const appInfo = module[appSlug] as AppInfo
const { factory } = appInfo
const cachePath = join(appPath, `test-data`)
Expand Down
12 changes: 12 additions & 0 deletions src/util/EnvVarNames.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { platform } from 'process'

export const EnvVarNames = {
// https://github.com/nodejs/node/issues/20605#issuecomment-387489708
Path: platform === 'win32' ? 'Path' : 'PATH',
ReallyPublish: 'GOBOT_PUBLISH_CONFIRM',
Verbosity: 'GOBOT_VERBOSITY',
UseNpm: 'GOBOT_USE_NPM',
NpmRegistryEndpoint: `npm_config_registry`,
NpmLocalRoot: `npm_config_prefix`,
PlopFilter: `__PLOP_FILTER__`,
} as const

0 comments on commit b933d91

Please sign in to comment.