Skip to content

Commit

Permalink
Merge pull request #11 from raegen/releases/v11
Browse files Browse the repository at this point in the history
v0.1.1
  • Loading branch information
raegen committed Jan 8, 2024
2 parents 0133070 + 29a424c commit f6574bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 4 additions & 3 deletions dist/nx.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions src/nx.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { existsSync } from 'node:fs'
import { join, resolve } from 'node:path'
import { createRequire } from 'node:module'
import { fileURLToPath } from 'url'

const getModule = (
entry: string
entry: string,
from = resolve(process.cwd(), 'package.json')
): {
main: string
root: string | undefined
Expand All @@ -13,7 +15,7 @@ const getModule = (
? entry.split('/').slice(0, 2).join('/')
: entry.split('/')[0]
: entry
const require = createRequire(resolve(process.cwd(), 'package.json'))
const require = createRequire(from)

return {
main: require.resolve(entry),
Expand All @@ -29,4 +31,7 @@ if (!root) {
}
export const nx = resolve(root, 'bin', 'nx.js')

export const runner = getModule('@raegen/github-runner').main
export const runner = getModule(
'@raegen/github-runner',
fileURLToPath(import.meta.url)
).main

0 comments on commit f6574bf

Please sign in to comment.