Skip to content

Commit

Permalink
handle comments
Browse files Browse the repository at this point in the history
  • Loading branch information
liweitian committed Nov 14, 2019
1 parent e22bfd5 commit d0eb0b2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Composer/packages/server/src/services/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ class StorageService {

constructor() {
this.storageConnections = Store.get(this.STORE_KEY);
this.storageConnections.forEach(s => {
this.createFolderRecurively(s.defaultPath);
});
this.createDefaultBotFolders();
}

public getStorageClient = (storageId: string): IFileStorage => {
Expand Down Expand Up @@ -48,6 +46,7 @@ class StorageService {
if (fs.existsSync(s.path)) {
temp.path = Path.resolve(s.path); // resolve path if path is relative, and change it to unix pattern
} else {
this.createDefaultBotFolders();
temp.path = Path.resolve(s.defaultPath);
}
return temp;
Expand Down Expand Up @@ -98,6 +97,12 @@ class StorageService {
Store.set(this.STORE_KEY, this.storageConnections);
};

private createDefaultBotFolders = () => {
this.storageConnections.forEach(s => {
this.createFolderRecurively(s.defaultPath);
});
};

private isBotFolder = (path: string) => {
// locate Main.dialog
const mainPath = Path.join(path, 'ComposerDialogs/Main', 'Main.dialog');
Expand Down

0 comments on commit d0eb0b2

Please sign in to comment.