Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
benallfree committed Apr 23, 2024
1 parent e74bdcd commit 7187bdb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion plop/plopfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { existsSync } from 'fs'
import 'node-fetch'
import { dirname, join } from 'path'
import type { NodePlopAPI } from 'plop'
import { fileURLToPath } from 'url'
import { appsRoot } from '../src/util/getApp'
import { stringify } from '../src/util/stringify'
import { buildCommand } from './commands/buildCommand'
Expand All @@ -14,8 +15,10 @@ import { publishCommand } from './commands/publishCommand'
import { testCommand } from './commands/testCommand'
import { updateCommand } from './commands/updateCommand'

const __dirname = dirname(fileURLToPath(import.meta.url))

const ROOT = findUpSync(`package.json`, {
cwd: dirname(new URL(import.meta.url).pathname),
cwd: __dirname,
})
if (!ROOT) {
throw new Error(`Can't find package.json in any parent path`)
Expand Down
7 changes: 4 additions & 3 deletions src/util/getApp.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { dirname, join } from 'path'
import { fileURLToPath } from 'url'
import type { AppInfo } from '../apps/'
import { dbge } from './log'
import { mkSetting } from './mkSetting'

export const appsRoot = mkSetting(
join(dirname(new URL(import.meta.url).pathname), `apps`),
)
const __dirname = dirname(fileURLToPath(import.meta.url))

export const appsRoot = mkSetting(join(__dirname, `..`, `apps`))

export const getApp = async (slug: string) => {
try {
Expand Down

0 comments on commit 7187bdb

Please sign in to comment.