Skip to content

Commit

Permalink
wip: debug nx17
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhunt27 committed Jan 24, 2024
1 parent ab09965 commit 958cf0a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
2 changes: 1 addition & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test('fake test for now', () => {
expect(true).toBeTruthy()
})

test('nx getAffected', () => {
test.skip('nx getAffected', () => {
const actual = getNxAffected({workspace: '.'})
expect(actual).toEqual([])
})
22 changes: 14 additions & 8 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "Github action for outputting a list of affected nx projects (apps and libs)",
"main": "lib/main.js",
"scripts": {
"nx": "nx",
"build": "tsc -p tsconfig.release.json",
"format": "prettier --write '**/*.ts'",
"format-check": "prettier --check '**/*.ts'",
Expand Down
27 changes: 19 additions & 8 deletions src/nx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,27 @@ const executeNxCommands = ({
let cmdSuccessful = false
let result: string | null = null

result = execSync('ls -la', {cwd: workspace}).toString()
core.info(`result: ${result}`)
result = execSync('ls -la', {cwd: `${workspace}/node_modules`}).toString()
core.info(`result: ${result}`)
result = execSync('ls -la', {
cwd: `${workspace}/node_modules/.bin`
cwd: `${workspace}/.nx/cache`
}).toString()
core.info(`result: ${result}`)
core.info(`/home/runner/work/rkt-artemis/rkt-artemis/.nx/cache: ${result}`)

result = execSync('ls -la', {
cwd: `${workspace}/node_modules/nx`
cwd: `/home/runner/work/rkt-artemis/rkt-artemis/node_modules/.bin`
}).toString()
core.info(
`/home/runner/work/rkt-artemis/rkt-artemis/node_modules/.bin: ${result}`
)

result = execSync('yarn nx --version', {
cwd: `/home/runner/work/rkt-artemis/rkt-artemis`
}).toString()
core.info(`yarn nx --version: ${result}`)

result = execSync('npm run nx --version', {
cwd: `/home/runner/work/rkt-artemis/rkt-artemis`
}).toString()
core.info(`result: ${result}`)
core.info(`npm run nx --version: ${result}`)

for (const cmd of commands) {
try {
Expand Down Expand Up @@ -51,6 +60,8 @@ export function getNxAffected({
const args = `${base ? `--base=${base}` : ''} ${head ? `--head=${head}` : ' --select=projects'}`
const commands = [
`./node_modules/.bin/nx print-affected --plain ${args}`,
`yarn nx print-affected --plain ${args}`,
`npm run nx print-affected --plain ${args}`,
`nx print-affected --plain ${args}`,
`npx nx print-affected --plain ${args}`
]
Expand Down

0 comments on commit 958cf0a

Please sign in to comment.