Skip to content

Commit 7fd0146

Browse files
authored
Merge pull request #130 from IBM/fix/include_file_fixes
Use file system provider for includes and ignore extension casing
2 parents 23dd88f + 7acd482 commit 7fd0146

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cli/src/languages/rpgle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function setupParser(targets: Targets): Parser {
5353
}
5454

5555
} else {
56-
const content = readFileSync(file, { encoding: `utf-8` });
56+
const content = await targets.rfs.readFile(file);
5757
includeFileCache[file] = content;
5858

5959
return {

cli/src/targets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ export class Targets {
10421042

10431043
const includeDetail = path.parse(include.toPath);
10441044

1045-
if (includeDetail.ext !== `.rpgleinc`) {
1045+
if (includeDetail.ext.toLowerCase() !== `.rpgleinc`) {
10461046
const possibleName = includeDetail.name.toLowerCase().endsWith(`.pgm`) ? includeDetail.name.substring(0, includeDetail.name.length - 4) : includeDetail.name;
10471047

10481048
if (this.suggestions.renames) {

0 commit comments

Comments
 (0)