Skip to content

sh1pt init default project name breaks on Windows paths #491

@ayskobtw-lil

Description

@ayskobtw-lil

Bug

sh1pt init currently derives the prompt's default project name with:

process.cwd().split('/').pop()

That works for POSIX-style paths, but on Windows process.cwd() uses backslashes. In a directory like C:\Users\alice\projects\my-app, the init prompt can default to the whole path instead of my-app.

Repro

Run sh1pt init from a Windows project directory and inspect the default value in the Project name prompt.

Expected

The default project name should be the basename of the current directory on both POSIX and Windows paths.

Proposed fix

Use a small path-normalizing helper for the init default name and cover both POSIX and Windows-style paths in a focused CLI test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions