Skip to content

Commit 97cb43e

Browse files
committed
feat: Added allow multiple support
1 parent b0ef2a4 commit 97cb43e

File tree

13 files changed

+30
-8
lines changed

13 files changed

+30
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "default",
3-
"version": "0.11.0",
3+
"version": "0.12.0",
44
"description": "",
55
"main": "dist/index.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
"ajv": "^8.12.0",
2424
"ajv-formats": "^2.1.1",
2525
"semver": "^7.6.0",
26-
"codify-plugin-lib": "1.0.141",
26+
"codify-plugin-lib": "1.0.148",
2727
"codify-schemas": "1.0.63",
2828
"chalk": "^5.3.0",
2929
"debug": "^4.3.4",

scripts/build.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ const mergedSchemas = [...schemasMap.entries()].map(([type, schema]) => {
7474

7575
delete resourceSchema.$id;
7676
delete resourceSchema.$schema;
77-
resourceSchema.description = `Resource type: "${type}" | ${resourceSchema.title}`;
7877
delete resourceSchema.title;
78+
delete resourceSchema.oneOf;
7979
delete resourceSchema.properties.type;
8080

8181
if (schema) {
8282
delete schema.$id;
8383
delete schema.$schema;
8484
delete schema.title;
85+
delete schema.oneOf;
8586
}
8687

8788
return mergeJsonSchemas([schema ?? {}, resourceSchema, { properties: { type: { const: type, type: 'string' } } }]);

src/resources/aws-cli/profile/aws-profile.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ export class AwsProfileResource extends Resource<AwsProfileConfig> {
4747
importAndDestroy:{
4848
refreshKeys: ['output', 'profile', 'awsAccessKeyId', 'awsSecretAccessKey', 'region'],
4949
requiredParameters: ['profile']
50+
},
51+
allowMultiple: {
52+
identifyingParameters: ['profile']
5053
}
5154
};
5255
}

src/resources/git/clone/git-clone.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export class GitCloneResource extends Resource<GitCloneConfig> {
2828
importAndDestroy:{
2929
requiredParameters: ['directory']
3030
},
31+
allowMultiple: {
32+
identifyingParameters: ['repository'],
33+
},
3134
dependencies: [
3235
'ssh-key',
3336
'ssh-add-key',

src/resources/git/git/git-resource.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export class GitResource extends Resource<GitConfig> {
2222
email: { type: 'stateful', definition: new GitEmailParameter(), },
2323
username: { type: 'stateful', definition: new GitNameParameter() },
2424
},
25-
2625
}
2726
}
2827

src/resources/homebrew/homebrew.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class HomebrewResource extends Resource<HomebrewConfig> {
3737
directory: { type: 'directory' },
3838
skipAlreadyInstalledCasks: { type: 'boolean', default: true, setting: true },
3939
onlyPlanUserInstalled: { type: 'boolean', default: true, setting: true },
40-
},
40+
}
4141
};
4242
}
4343

src/resources/java/jenv/java-versions-parameter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export class JenvAddParameter extends ArrayStatefulParameter<JenvConfig, string>
119119

120120
try {
121121
await codifySpawn(`jenv add ${location}`, { throws: true });
122-
} catch (error: Error) {
123-
if (error.message.includes('jenv: cannot rehash')) {
122+
} catch (error: unknown) {
123+
if (error instanceof Error && error.message.includes('jenv: cannot rehash')) {
124124
await this.rehash();
125125
return;
126126
}

src/resources/scripting/action.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export class ActionResource extends Resource<ActionConfig> {
2121
},
2222
importAndDestroy: {
2323
preventImport: true,
24-
}
24+
},
25+
allowMultiple: true,
2526
}
2627
}
2728

src/resources/scripting/file.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export class FileResource extends Resource<FileConfig> {
2424
importAndDestroy:{
2525
refreshKeys: ['path', 'contents'],
2626
requiredParameters: ['path']
27+
},
28+
allowMultiple: {
29+
identifyingParameters: ['path']
2730
}
2831
}
2932
}

src/resources/shell/alias/alias-resource.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export class AliasResource extends Resource<AliasConfig> {
3030
parameterSettings: {
3131
value: { canModify: true }
3232
},
33+
allowMultiple: {
34+
identifyingParameters: ['alias']
35+
}
3336
}
3437
}
3538

0 commit comments

Comments
 (0)