Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Issue #1865 #1869

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export default class ProjectsController {
project: ProjectShape
session: Session

UpdatedJsonStringify(json: string): string {
return json.replace(/("(?:\\"|[^"])*")\s*:/g, (_, value) => {
return value.replace(/\s/g, '') + ':';
});
}

async executeHook(
hookName: keyof Pick<
BaseController,
Expand Down Expand Up @@ -198,7 +204,7 @@ export default class ProjectsController {
}

async save_v3(filepath: string): Promise<boolean> {
await fs.writeFile(filepath, JSON.stringify(this.project, undefined, 2))
await fs.writeFile(filepath, this.UpdatedJsonStringify(JSON.stringify(this.project, undefined, 2)))
this.recentProjects.add(filepath)
this.session.projects.filepath = filepath
return true
Expand Down