Skip to content

Commit

Permalink
Throw an error if the requested config file does not exist/is not fou…
Browse files Browse the repository at this point in the history
…nd (#1231)

feat: throw error if requested config file not found
  • Loading branch information
EagleoutIce authored Jan 6, 2025
1 parent d6e362a commit 6a2ec85
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cli/flowr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { repl, replProcessAnswer } from './repl/core';
import { printVersionInformation } from './repl/commands/repl-version';
import { printVersionRepl } from './repl/print-version';
import { defaultConfigFile, flowrMainOptionDefinitions, getScriptsText } from './flowr-main-options';
import fs from 'fs';

export const toolName = 'flowr';

Expand Down Expand Up @@ -87,6 +88,13 @@ if(options['config-json']) {
}
}
if(!usedConfig) {
if(options['config-file']) {
// validate it exists
if(!fs.existsSync(options['config-file'])) {
log.error(`Config file '${options['config-file']}' does not exist`);
process.exit(1);
}
}
setConfigFile(options['config-file'] ?? defaultConfigFile, undefined, true);
}

Expand Down

2 comments on commit 6a2ec85

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"artificial" Benchmark Suite

Benchmark suite Current: 6a2ec85 Previous: 193493e Ratio
Retrieve AST from R code 246.79377977272728 ms (100.78024948956383) 236.3631803181818 ms (96.3414320076851) 1.04
Normalize R AST 17.670501 ms (30.17658640840279) 16.913317227272728 ms (29.999587728462018) 1.04
Produce dataflow information 69.39041404545455 ms (152.38681947510307) 65.89893436363637 ms (142.81728859304584) 1.05
Total per-file 853.1233628181818 ms (1537.087885194574) 838.4056316818181 ms (1528.5998928788965) 1.02
Static slicing 2.0545955924597803 ms (1.198828674823342) 2.0272357895131496 ms (1.140695509301643) 1.01
Reconstruct code 0.2347461619049836 ms (0.1854374528822857) 0.22794475391580074 ms (0.17048234005806254) 1.03
Total per-slice 2.30282172553284 ms (1.2686527388760267) 2.2687764323735546 ms (1.2083956198769428) 1.02
failed to reconstruct/re-parse 0 # 0 # 1
times hit threshold 0 # 0 # 1
reduction (characters) 0.7891949660994808 # 0.7891949660994808 # 1
reduction (normalized tokens) 0.7665650684287274 # 0.7665650684287274 # 1
memory (df-graph) 95.19682173295455 KiB (244.24808975931026) 95.19682173295455 KiB (244.24808975931026) 1

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"social-science" Benchmark Suite

Benchmark suite Current: 6a2ec85 Previous: 193493e Ratio
Retrieve AST from R code 248.24343291999998 ms (45.5670974947841) 239.83494634000002 ms (44.091585283717734) 1.04
Normalize R AST 19.278038379999998 ms (14.538320974034734) 18.75151096 ms (14.043201910950488) 1.03
Produce dataflow information 80.06457856 ms (75.30874296346218) 78.18609565999999 ms (74.2114422379391) 1.02
Total per-file 7613.2842913800005 ms (29551.162639229038) 7533.92321098 ms (29636.25828137677) 1.01
Static slicing 15.311145043609915 ms (44.66054801375166) 15.208209336602515 ms (44.74548831215854) 1.01
Reconstruct code 0.2902254676886922 ms (0.16174596687408677) 0.24570827411135815 ms (0.1455091615894726) 1.18
Total per-slice 15.60975451092548 ms (44.68887668148015) 15.461665096914391 ms (44.78032403557931) 1.01
failed to reconstruct/re-parse 0 # 0 # 1
times hit threshold 0 # 0 # 1
reduction (characters) 0.8760481407790371 # 0.8760481407790371 # 1
reduction (normalized tokens) 0.8152466834674152 # 0.8152466834674152 # 1
memory (df-graph) 99.6448046875 KiB (113.2159841674677) 99.6448046875 KiB (113.2159841674677) 1

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.