Skip to content

Commit

Permalink
handling global actions & renamed method
Browse files Browse the repository at this point in the history
  • Loading branch information
allardy committed Aug 9, 2019
1 parent 5c024c6 commit 5be2a8f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/bp/core/services/action/action-service.ts
Expand Up @@ -53,7 +53,11 @@ export default class ActionService {
.filter(r => r.match(/(\\|\/)actions(\\|\/)/g))
.map(file => delete require.cache[file])

await this.ghost.forBot(botId).syncRemoteFiles('actions')
if (botId === 'global') {
await this.ghost.global().syncDatabaseFilesToDisk('actions')
} else {
await this.ghost.forBot(botId).syncDatabaseFilesToDisk('actions')
}
}

forBot(botId: string): ScopedActionService {
Expand Down
2 changes: 1 addition & 1 deletion src/bp/core/services/ghost/service.ts
Expand Up @@ -365,7 +365,7 @@ export class ScopedGhostService {
await this.primaryDriver.moveFile(fromPath, toPath)
}

async syncRemoteFiles(rootFolder: string): Promise<void> {
async syncDatabaseFilesToDisk(rootFolder: string): Promise<void> {
if (this.primaryDriver instanceof DiskStorageDriver) {
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/bp/core/services/hook/hook-service.ts
Expand Up @@ -159,7 +159,7 @@ export class HookService {
.filter(r => r.match(/(\\|\/)hooks(\\|\/)/g))
.map(file => delete require.cache[file])

await this.ghost.global().syncRemoteFiles('hooks')
await this.ghost.global().syncDatabaseFilesToDisk('hooks')
}

async executeHook(hook: Hooks.BaseHook): Promise<void> {
Expand Down

0 comments on commit 5be2a8f

Please sign in to comment.