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

CLI fails when file from --to file is missing #24

Open
mximp opened this issue Oct 20, 2022 · 1 comment
Open

CLI fails when file from --to file is missing #24

mximp opened this issue Oct 20, 2022 · 1 comment

Comments

@mximp
Copy link

mximp commented Oct 20, 2022

Running polystat-cli with the following command:

sudo java -jar polystat.jar eo --in temp/sources/eo --to file=results/polystat-eo-out.txt --sarif

Got exception:

java.lang.Exception: results/polystat-eo-out.txt is either not a regular file or does not exist!
	at org.polystat.cli.util.FileTypes$File$.fromPathFailFast$$anonfun$2(FileTypes.scala:63)
	at delay @ fs2.io.file.FilesCompanionPlatform$AsyncFiles.isRegularFile(FilesPlatform.scala:273)
	at ifM @ org.polystat.cli.util.FileTypes$Directory$.fromPath(FileTypes.scala:23)
	at flatMap @ org.polystat.cli.util.FileTypes$File$.fromPathFailFast(FileTypes.scala:66)
	at map @ org.polystat.cli.PolystatOpts$.files$$anonfun$1$$anonfun$1$$anonfun$1(PolystatOpts.scala:209)
	at map @ org.polystat.cli.PolystatOpts$.files$$anonfun$1$$anonfun$1$$anonfun$1(PolystatOpts.scala:216)
	at flatMap @ org.polystat.cli.PolystatOpts$.files$$anonfun$1$$anonfun$1(PolystatOpts.scala:216)
	at map @ org.polystat.cli.PolystatOpts$.analyzerConfig$$anonfun$1$$anonfun$1$$anonfun$2(PolystatOpts.scala:227)
	at flatMap @ org.polystat.cli.PolystatOpts$.analyzerConfig$$anonfun$1$$anonfun$1(PolystatOpts.scala:227)
	at delay @ fs2.io.file.FilesCompanionPlatform$AsyncFiles.isDirectory(FilesPlatform.scala:256)
	at ifM @ org.polystat.cli.util.FileTypes$Directory$.fromPath(FileTypes.scala:23)
	at flatMap @ org.polystat.cli.util.InputUtils$.toInput(InputUtils.scala:51)
	at flatMap @ org.polystat.cli.PolystatOpts$.analyzerConfig$$anonfun$1(PolystatOpts.scala:227)
	at map @ org.polystat.cli.PolystatOpts$.analyzeEO$$anonfun$1(PolystatOpts.scala:41)
	at flatMap @ org.polystat.cli.Main$.run$$anonfun$1(Main.scala:31)
	at as @ org.polystat.cli.Main$.run$$anonfun$1(Main.scala:31)
	at map @ com.monovore.decline.effect.CommandIOApp$.run$$anonfun$4(CommandIOApp.scala:40)

If empty file results/polystat-eo-out.txt is created beforehand, the run succeed.

I would assume the out file should be automatically created in this case.

Test environment:

@mximp mximp changed the title CLI fails when --to file is missing CLI fails when file from --to file is missing Oct 20, 2022
@nikololiahim
Copy link
Member

@mximp Thank you for reporting! According to release logs, this issue should be fixed in versions >= 0.1.12.

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