Skip to content

Studio.new() doubles tilde when path starts with ~/ #8

@williamsharkey

Description

@williamsharkey

Bug Description

Studio.new('~/code-metrics.js') creates a file at ~/~/code-metrics.js instead of ~/code-metrics.js.

Steps to Reproduce

Studio.new('~/myfile.js')
// Returns: {success: true, path: "~/~/myfile.js"}

Expected Behavior

Studio.new('~/myfile.js')
// Returns: {success: true, path: "~/myfile.js"}

Current Workaround

Studio.new('myfile.js')  // Without ~/ prefix
// Returns: {success: true, path: "~/myfile.js"}

Root Cause

Likely the new() function prepends ~/ unconditionally without checking if the path already starts with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions