Skip to content

Commit ecf6481

Browse files
committed
Add mode to turn actions support on and off
Signed-off-by: worksofliam <[email protected]>
1 parent 4fc8538 commit ecf6481

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

cli/src/builders/make/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export class MakeProject {
2424
private noChildren: boolean = false;
2525
private settings: iProject = new iProject();
2626
private projectActions: ProjectActions;
27+
private actionsEnabled: boolean = false;
2728

2829
private folderSettings: {[folder: string]: FolderOptions} = {};
2930

@@ -35,8 +36,14 @@ export class MakeProject {
3536
this.noChildren = noChildren;
3637
}
3738

39+
public useActions() {
40+
this.actionsEnabled = true;
41+
}
42+
3843
async setupSettings() {
39-
await this.projectActions.loadAllActions();
44+
if (this.actionsEnabled) {
45+
await this.projectActions.loadAllActions();
46+
}
4047

4148
// First, let's setup the project settings
4249
try {

cli/test/cs_srvpgm.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ describe(`pseudo tests`, () => {
7878

7979
test('makefile', async () => {
8080
const makefile = new MakeProject(targets.getCwd(), targets, fs);
81+
makefile.useActions();
8182
await makefile.setupSettings();
8283

8384
const contents = makefile.getMakefile().join(`\n`);
@@ -87,8 +88,7 @@ describe(`pseudo tests`, () => {
8788

8889
expect(contents).not.toContain(`EMPDET.SRVPGM`); // Ensure no service program is created
8990
expect(contents).toContain(`EMPDET.MODULE`);
90-
91-
console.log(contents);
91+
expect(contents).toContain(`CRTSQLRPGI OBJ($(BIN_LIB)/EMPDET) SRCSTMF('qrpglesrc/empdet.sqlrpgle') COMMIT(*NONE) DBGVIEW(*SOURCE) COMPILEOPT('TGTCCSID(*JOB)') RPGPPOPT(*LVL2) OPTION(*EVENTF) OBJTYPE(*MODULE)`);
9292

9393
// As picked up from the actions.json
9494
expect(contents).toContain(`system "CRTBNDRPG NAME(mypgm) THEPARM('qrpglesrc/mypgm.pgm.rpgle')" > .logs/mypgm.splf`);

0 commit comments

Comments
 (0)