Skip to content

Commit

Permalink
docs: add installation example
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkluijk committed Jan 5, 2025
1 parent a2a9583 commit 24a9c74
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@ Simple CLI script written in Deno to sync Spotify tracks from a raw text to a Sp

## Usage

[Install Deno], and run:
[Install Deno] and install the script with Deno:

[Install Deno]: https://docs.deno.com/runtime/getting_started/installation/

```bash
deno run --allow-net jsr:@dirkluijk/text-to-playlist <inputFileOrText> --playlist <playlistUrl>
deno install jsr:@dirkluijk/text-to-playlist --global
```

Now just run it:
```bash
text-to-playlist <inputFileOrText> --playlist <playlistUrl>
```

To run the script without installing, run:
```bash
deno run jsr:@dirkluijk/text-to-playlist <inputFileOrText> --playlist <playlistUrl>
```

## Options
Expand Down
3 changes: 3 additions & 0 deletions src/utils/spotify-authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function waitForAuthorization(options: { port: number }): Promise<string> {
}

export async function retrieveAccessToken(): Promise<string> {
// request permissions upfront
await Deno.permissions.request({ name: "net", host: '0.0.0.0:8888' });

// ask user authorization
await open(
"https://accounts.spotify.com/authorize?" +
Expand Down

0 comments on commit 24a9c74

Please sign in to comment.