Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common
2 changes: 1 addition & 1 deletion lib/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ interface IProjectNameService {
* @param {IOptions} current command options.
* @return {Promise<strng>} returns the selected name of the project.
*/
ensureValidName(projectName: string, validateOptions?: { force: boolean }): Promise<string>;
ensureValidName(projectName: string, validateOptions?: IForceOption): Promise<string>;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/services/analytics/analytics-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export class AnalyticsService extends AnalyticsServiceBase {
await this.trackInGoogleAnalytics(googleAnalyticsEventData);
}

public dispose(): void {
if (this.brokerProcess && this.shouldDisposeInstance) {
public dispose(disposeOptions?: IForceOption): void {
if (this.brokerProcess && (disposeOptions && disposeOptions.force || this.shouldDisposeInstance)) {
this.brokerProcess.disconnect();
}
}
Expand Down
2 changes: 2 additions & 0 deletions lib/services/livesync/livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
// In case we are stopping the LiveSync we must set usbLiveSyncService.isInitialized to false,
// as in case we execute nativescript-dev-typescript's before-prepare hook again in the same process, it MUST transpile the files.
this.$usbLiveSyncService.isInitialized = false;
// After stopping LiveSync we need to dispose of everything in order for the process to end and release all resources
this.$injector.dispose({ force: true });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will cause issues with device detection in Sidekick where we have a long living process. We shouldn't dispose the injector in this case, as this will kill iOS devices detection as well. We should find a better general solution for this case.

} else if (liveSyncProcessInfo.currentSyncAction && shouldAwaitPendingOperation) {
await liveSyncProcessInfo.currentSyncAction;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/services/project-name-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class ProjectNameService implements IProjectNameService {
private $logger: ILogger,
private $prompter: IPrompter) { }

public async ensureValidName(projectName: string, validateOptions?: { force: boolean }): Promise<string> {
public async ensureValidName(projectName: string, validateOptions?: IForceOption): Promise<string> {
if (validateOptions && validateOptions.force) {
return projectName;
}
Expand Down Expand Up @@ -41,7 +41,7 @@ export class ProjectNameService implements IProjectNameService {
return startsWithLetterExpression.test(projectName);
}

private async promptForNewName(warningMessage: string, projectName: string, validateOptions?: { force: boolean }): Promise<string> {
private async promptForNewName(warningMessage: string, projectName: string, validateOptions?: IForceOption): Promise<string> {
if (await this.promptForForceNameConfirm(warningMessage)) {
return projectName;
}
Expand Down