Skip to content

Configuration/ Token isn't being detected in workspace + Home dir being created inside workspace #1226

@arayofcode

Description

@arayofcode

After following the CLI Walkthrough, I setup my token. When I'm outside my workspace, the configuration is present:

pwd
/Users/ray/code
❯ exercism configure

You have configured the Exercism command-line client:

Config dir:                       ~/.config/exercism
Token:         (-t, --token)      ...
Workspace:     (-w, --workspace)  /Users/ray/code/exercism
API Base URL:  (-a, --api)        https://api.exercism.org/v1

However, when I'm inside the workspace, the configuration is missing.

pwd
/Users/ray/code/exercism
❯ exercism configure
Error: There is no token configured. Find your token on https://exercism.org/settings/api_cli, and call this command again with --token=<your-token>.

To fix this, on running exercism configure --token=YOUR_TOKEN, the home directory ~ was being incorrectly created inside my workspace.
Looking at the code, I discovered this happened because the path was being treated as relative even when it was absolute path, creating ~.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions