From 9b83211ad47aab8a664d67ac9b66fcfa6e76e987 Mon Sep 17 00:00:00 2001 From: RuiNtD Date: Sun, 20 Oct 2024 17:39:10 -0600 Subject: [PATCH] Require `bun install` --- README.md | 11 ++++++++++- src/manager.ts | 15 ++++++++++----- start.bat | 1 + 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e22743b..424e333 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,16 @@ Supports [Last.fm] and [ListenBrainz] ## Requirements +- [Git](https://git-scm.com/) - [Bun](https://bun.sh) +## Setup + +```sh +git clone https://github.com/RuiNtD/lastfm-rp +bun install +``` + ## Configuration Before running Scrobble RP, please copy `config.example.yml` to `config.yml` @@ -16,11 +24,12 @@ and edit it to your liking. `username` is required. The "Disable when another app's Rich Presence is detected" feature uses [Lanyard]. If you would like to use this feature, you will need to join the [Lanyard Discord]. -Run `manager` if you want Scrobble RP to run at startup +Use `manager` if you want Scrobble RP to run at startup ## Usage Run `start` to start Scrobble Rich Presence. +`manager` includes an option to update the script. ## Special Thanks! diff --git a/src/manager.ts b/src/manager.ts index 9d282f8..30ce283 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -74,15 +74,20 @@ while (true) { try { console.log(chalk.gray("Updating...")); await $`git pull`; - if (await fs.exists("node_modules")) { - console.log(chalk.gray("Installing dependencies...")); - await $`bun install`; - } + + console.log(chalk.gray("Installing dependencies...")); + await $`bun install`; + if (await run.isEnabled()) { console.log(chalk.gray("Restarting process...")); await run.start(); } - console.log(chalk.bold.green("Updated!"), "Manager will now close"); + + console.log( + chalk.bold.green("Updated!"), + "Make sure Bun is up to date.", + ); + console.log("Manager will now close"); await pause(); process.exit(); } catch (e) { diff --git a/start.bat b/start.bat index 07bf979..ad82b66 100644 --- a/start.bat +++ b/start.bat @@ -1,3 +1,4 @@ @echo off title Scrobble Rich Presence bun start +pause