Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.21.0 throws NSInvalidArgumentException for currentDirectoryURL #639

Open
msunjo opened this issue Jan 23, 2025 · 1 comment
Open

3.21.0 throws NSInvalidArgumentException for currentDirectoryURL #639

msunjo opened this issue Jan 23, 2025 · 1 comment

Comments

@msunjo
Copy link

msunjo commented Jan 23, 2025

Hello, I was using danger-swift where I needed to change current working directory to parent directory. The command looks like this: danger-swift local --dangerfile <danger-file-path> --cwd ../ and it worked on version 3.20.0, but now it throws an exception. How should the path be passed now?

Error print:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSConcreteTask setCurrentDirectoryURL:]: non-file URL argument'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007ff816972b8e __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007ff816458f12 objc_exception_throw + 62
	2   Foundation                          0x00007ff8181c4bfa -[NSTask currentDirectoryURL] + 0
	3   danger-swift                        0x0000000102ede93c $s6Runner9runDanger7version6loggerySS_6LoggerAEVtKF + 13772
	4   danger-swift                        0x0000000102ee230a $s6Runner10runCommand33_DF2CC3DD2A89F7C463377197A13465C6LL_6loggery0A3Lib06DangerC0O_6LoggerAHVtKF + 266
	5   danger-swift                        0x0000000102ee1e02 Runner_main + 2242
	6   dyld                                0x000000020331e2cd start + 1805
)

libc++abi: terminating due to uncaught exception of type NSException

Error:  Error: Got no results back from the Dangerfile evaluation, this is likely an issue with a custom sub-process exiting early.
    at Executor.<anonymous> (/snapshot/danger-js/distribution/runner/Executor.js:152:35)
    at step (/snapshot/danger-js/distribution/runner/Executor.js:33:23)
    at Object.next (/snapshot/danger-js/distribution/runner/Executor.js:14:53)
    at /snapshot/danger-js/distribution/runner/Executor.js:8:71
    at new Promise (<anonymous>)
    at /snapshot/danger-js/distribution/runner/Executor.js:4:12
    at Executor.handleResults (/snapshot/danger-js/distribution/runner/Executor.js:146:16)
    at /snapshot/danger-js/distribution/commands/utils/runDangerSubprocess.js:174:47
    at step (/snapshot/danger-js/distribution/commands/utils/runDangerSubprocess.js:44:23)
    at Object.next (/snapshot/danger-js/distribution/commands/utils/runDangerSubprocess.js:25:53)
@f-meloni
Copy link
Member

f-meloni commented Jan 23, 2025

OK, this is likely related to this diff #634 (cc. @417-72KI ) I think it might be task.currentDirectoryURL = URL(fileURLWithPath: FileManager.default.currentDirectoryPath), this should probably be task.currentDirectoryURL = URL(string: FileManager.default.currentDirectoryPath)!, or something like that, I will try to see if that is the issue today or tomorrow morning.
Worst case I will revert only that line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants