Skip to content

Commit 58defa6

Browse files
authored
Merge pull request #71 from gary-kim/fix/noid/22
Add before_cmds for use with circles app
2 parents cf23c8c + 5366087 commit 58defa6

File tree

7 files changed

+41
-5
lines changed

7 files changed

+41
-5
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.0.0
1+
v22.2.0

config.schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@
100100
"type": "string"
101101
}
102102
},
103+
"before_cmds": {
104+
"description": "Commands to run in the app directory just after cloning",
105+
"type": "array",
106+
"default": [],
107+
"items": {
108+
"type": "string"
109+
}
110+
},
103111
"appsDir": {
104112
"type": "string",
105113
"description": "Directory in which to place the app",

configs/v22.0.0.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
"repo": "https://github.com/nextcloud/activity"
4444
},
4545
"circles": {
46-
"repo": "https://github.com/nextcloud/circles"
46+
"repo": "https://github.com/nextcloud/circles",
47+
"before_cmds": [
48+
"composer i"
49+
]
4750
},
4851
"files_pdfviewer": {
4952
"repo": "https://github.com/nextcloud/files_pdfviewer"

configs/v22.1.0.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
"repo": "https://github.com/nextcloud/activity"
4444
},
4545
"circles": {
46-
"repo": "https://github.com/nextcloud/circles"
46+
"repo": "https://github.com/nextcloud/circles",
47+
"before_cmds": [
48+
"composer i"
49+
]
4750
},
4851
"files_pdfviewer": {
4952
"repo": "https://github.com/nextcloud/files_pdfviewer"

configs/v22.1.1.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
"repo": "https://github.com/nextcloud/activity"
4444
},
4545
"circles": {
46-
"repo": "https://github.com/nextcloud/circles"
46+
"repo": "https://github.com/nextcloud/circles",
47+
"before_cmds": [
48+
"composer i"
49+
]
4750
},
4851
"files_pdfviewer": {
4952
"repo": "https://github.com/nextcloud/files_pdfviewer"

configs/v22.2.0.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
"repo": "https://github.com/nextcloud/activity"
4444
},
4545
"circles": {
46-
"repo": "https://github.com/nextcloud/circles"
46+
"repo": "https://github.com/nextcloud/circles",
47+
"before_cmds": [
48+
"composer i"
49+
]
4750
},
4851
"files_pdfviewer": {
4952
"repo": "https://github.com/nextcloud/files_pdfviewer"

index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,27 @@ async function addApp (appName, appsDir, appConfig) {
202202
await appGit.submoduleUpdate();
203203
}
204204

205+
await arbitraryCommandsApp(appName, appDir, appConfig);
205206
await krankerlEnabledAppSetup(appName, appDir, appConfig);
206207
await nextcloudIgnore(appName, appDir, appConfig);
207208
await globRemove(appConfig.exclude, appDir);
208209
}
209210

211+
/**
212+
* Run commands given in before_cmds
213+
* @param {String} appName Name of Nextcloud app to add
214+
* @param {String} appDir Apps directory in Nextcloud
215+
* @param {Object} appConfig App Config object
216+
*/
217+
async function arbitraryCommandsApp (appName, appDir, appConfig) {
218+
logMessage(`${appName}: running config before_cmds`, LOGVERBOSITY.MEDIUM);
219+
if (appConfig.before_cmds && appConfig.before_cmds.length > 0) {
220+
appConfig.before_cmds.forEach(cmd => {
221+
execSync(cmd, { cwd: appDir, stdio: 'inherit' });
222+
});
223+
}
224+
}
225+
210226
/**
211227
* Check if Krankerl is enabled then run Krankerl config
212228
* @param {String} appName Name of Nextcloud app to add

0 commit comments

Comments
 (0)