This repository was archived by the owner on Jul 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 375
fix: zip file can not be deleted #4760
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b3b9229
fix zip file can not be deleted
VanyLaw fc33870
fix comment
VanyLaw 3b49390
use composer logger instead of console
a-b-r-o-w-n 534944d
fix format string
a-b-r-o-w-n eaea690
Merge branch 'main' into wenyluo/fix4704
a-b-r-o-w-n de90993
Merge branch 'main' into wenyluo/fix4704
a-b-r-o-w-n a002fc7
Merge branch 'main' into wenyluo/fix4704
cwhitten 2bb3bad
Merge branch 'main' into wenyluo/fix4704
luhan2017 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,9 +166,14 @@ export default async (composer: ExtensionRegistration): Promise<void> => { | |
| * @param resourcekey | ||
| */ | ||
| private async cleanup(resourcekey: string) { | ||
| const projFolder = this.getRuntimeFolder(resourcekey); | ||
| await emptyDir(projFolder); | ||
| await rmdir(projFolder); | ||
| try { | ||
| const projFolder = this.getRuntimeFolder(resourcekey); | ||
| await emptyDir(projFolder); | ||
| await rmdir(projFolder); | ||
| } catch (error) { | ||
| console.error(error); | ||
|
a-b-r-o-w-n marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -334,34 +339,53 @@ export default async (composer: ExtensionRegistration): Promise<void> => { | |
| runtimeCodePath = project.settings.runtime.path; | ||
| } | ||
|
|
||
| // Prepare the temporary project | ||
| // this writes all the settings to the root settings/appsettings.json file | ||
| await this.init(project, runtimeCodePath, resourcekey, runtime); | ||
| try { | ||
| // Prepare the temporary project | ||
| // this writes all the settings to the root settings/appsettings.json file | ||
| await this.init(project, runtimeCodePath, resourcekey, runtime); | ||
|
|
||
| // Merge all the settings | ||
| // this combines the bot-wide settings, the environment specific settings, and 2 new fields needed for deployed bots | ||
| // these will be written to the appropriate settings file inside the appropriate runtime plugin. | ||
| const mergedSettings = mergeDeep(fullSettings, settings); | ||
|
|
||
| // Prepare parameters and then perform the actual deployment action | ||
| const customizeConfiguration: CreateAndDeployResources = { | ||
| accessToken, | ||
| subscriptionID, | ||
| name, | ||
| environment, | ||
| hostname, | ||
| luisResource, | ||
| }; | ||
| await this.performDeploymentAction( | ||
| project, | ||
| mergedSettings, | ||
| runtime, | ||
| project.id, | ||
| profileName, | ||
| jobId, | ||
| resourcekey, | ||
| customizeConfiguration | ||
| ); | ||
| } catch (err) { | ||
| console.log(err); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Composer logger. |
||
| if (err instanceof Error) { | ||
| this.logMessages.push(err.message); | ||
| } else if (typeof err === 'object') { | ||
| this.logMessages.push(JSON.stringify(err)); | ||
| } else { | ||
| this.logMessages.push(err); | ||
| } | ||
|
|
||
| // Merge all the settings | ||
| // this combines the bot-wide settings, the environment specific settings, and 2 new fields needed for deployed bots | ||
| // these will be written to the appropriate settings file inside the appropriate runtime plugin. | ||
| const mergedSettings = mergeDeep(fullSettings, settings); | ||
| const response = this.getLoadingStatus(project.id, profileName, jobId); | ||
| response.status = 500; | ||
| response.result.message = this.logMessages[this.logMessages.length - 1]; | ||
|
|
||
| // Prepare parameters and then perform the actual deployment action | ||
| const customizeConfiguration: CreateAndDeployResources = { | ||
| accessToken, | ||
| subscriptionID, | ||
| name, | ||
| environment, | ||
| hostname, | ||
| luisResource, | ||
| }; | ||
| await this.performDeploymentAction( | ||
| project, | ||
| mergedSettings, | ||
| runtime, | ||
| project.id, | ||
| profileName, | ||
| jobId, | ||
| resourcekey, | ||
| customizeConfiguration | ||
| ); | ||
| await this.updateHistory(project.id, profileName, { status: response.status, ...response.result }); | ||
| this.removeLoadingStatus(project.id, profileName, jobId); | ||
| this.cleanup(resourcekey); | ||
| } | ||
| }; | ||
|
|
||
| /************************************************************************************************** | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.