Add curl-pipe installer, uninstaller, and contributor bootstrap
End-user installation collapses to a single command: curl -fsSL https://gitea.cahlen.com/nokeo08/Move/raw/branch/master/install.sh | sh Changes: - install.sh rewritten as a POSIX sh, curl-pipeable end-user installer. Honors XDG_DATA_HOME and XDG_BIN_HOME (de facto). Idempotent via a version-marker file at $INSTALL_DIR/.installed-version; MOVE_FORCE=1 overrides. Hard-fails if Bun is missing (no auto-install). Includes a safety guard refusing rm -rf on too-broad install dirs. - uninstall.sh added; same curl-pipe pattern, shared XDG path resolution, leaves Bun alone. - dev-setup.sh added (= the previous install.sh content, retitled for contributors and pointing at bun run start / bun link / install.sh). - README updated: curl one-liner Install section, XDG behavior tables, new Uninstall section, new 'For contributors' section, Files table rows for all three scripts.
This commit is contained in:
@@ -11,7 +11,7 @@ cursor leaves the position the script just commanded.
|
||||
## Requirements
|
||||
|
||||
- [Bun](https://bun.sh) >= 1.0.0
|
||||
- macOS, Linux, or Windows (relies on
|
||||
- macOS or Linux (relies on
|
||||
[`@nut-tree-fork/nut-js`](https://github.com/nut-tree-fork/nut.js) for
|
||||
cross-platform mouse + screen control)
|
||||
- On macOS: Accessibility permission for the terminal running Bun
|
||||
@@ -20,38 +20,53 @@ cursor leaves the position the script just commanded.
|
||||
## Install
|
||||
|
||||
```sh
|
||||
./install.sh
|
||||
curl -fsSL https://gitea.cahlen.com/nokeo08/Move/raw/branch/master/install.sh | sh
|
||||
```
|
||||
|
||||
The installer verifies `bun` is on `PATH` and runs `bun install`. It does
|
||||
not auto-install Bun; if Bun is missing it prints a hard error pointing at
|
||||
<https://bun.sh>.
|
||||
This fetches the latest `master` from Gitea, runs `bun install --production`
|
||||
under the install dir, and drops a `move` wrapper on your bin dir.
|
||||
|
||||
The installer respects the XDG Base Directory Specification:
|
||||
|
||||
- Source lives at `$XDG_DATA_HOME/move` (default `~/.local/share/move`).
|
||||
- Wrapper goes to `$XDG_BIN_HOME/move` (default `~/.local/bin/move`).
|
||||
`XDG_BIN_HOME` is the widely-recognized de facto convention; XDG itself
|
||||
doesn't standardize a user bin dir.
|
||||
|
||||
Env vars (all optional):
|
||||
|
||||
| Var | Default | Purpose |
|
||||
| --- | ------- | ------- |
|
||||
| `MOVE_VERSION` | `master` | Branch or tag to install. Pin with e.g. `v1.0.0`. |
|
||||
| `MOVE_FORCE` | unset | Set to `1` to reinstall when the same version is already present. |
|
||||
| `XDG_DATA_HOME` | `$HOME/.local/share` | Where the source tree is installed (under `move/`). |
|
||||
| `XDG_BIN_HOME` | `$HOME/.local/bin` | Where the `move` wrapper is placed. |
|
||||
|
||||
Bun must already be installed; the installer fails with a clear pointer
|
||||
to <https://bun.sh> if it isn't.
|
||||
|
||||
If your bin dir isn't on `PATH`, the installer prints the line to add to
|
||||
your shell rc. It will not modify rc files for you.
|
||||
|
||||
## Run
|
||||
|
||||
```sh
|
||||
bun run start
|
||||
```
|
||||
|
||||
Or directly:
|
||||
|
||||
```sh
|
||||
bun run src/move.ts
|
||||
```
|
||||
|
||||
Or install it as a global `move` command via Bun's bin-linking:
|
||||
|
||||
```sh
|
||||
bun link
|
||||
move
|
||||
move --help
|
||||
```
|
||||
|
||||
`bun link` registers the `bin.move` entry from `package.json` (`./src/move.ts`,
|
||||
which carries `#!/usr/bin/env bun`) as an executable on your `PATH`.
|
||||
|
||||
Stop with `Ctrl+C`. If `SIGINT` arrives mid-sweep, the cursor stays at
|
||||
whichever step was last commanded — by design.
|
||||
|
||||
## Uninstall
|
||||
|
||||
```sh
|
||||
curl -fsSL https://gitea.cahlen.com/nokeo08/Move/raw/branch/master/uninstall.sh | sh
|
||||
```
|
||||
|
||||
Removes the wrapper at `$XDG_BIN_HOME/move` and the install tree at
|
||||
`$XDG_DATA_HOME/move`. Bun stays — it's your runtime, not ours.
|
||||
|
||||
## Usage
|
||||
|
||||
```text
|
||||
@@ -68,12 +83,9 @@ Options:
|
||||
(default prints only the startup banner).
|
||||
```
|
||||
|
||||
Run `bun run src/move.ts --help` for the full text.
|
||||
|
||||
All flags are wired. Numeric overrides are layered onto the defaults via
|
||||
`resolveConfig` in `src/config.ts`; time-valued inputs (`-m`, `-c`) are
|
||||
expressed in seconds at the CLI boundary and converted to milliseconds
|
||||
internally.
|
||||
Numeric overrides are layered onto the defaults via `resolveConfig` in
|
||||
`src/config.ts`; time-valued inputs (`-m`, `-c`) are expressed in seconds
|
||||
at the CLI boundary and converted to milliseconds internally.
|
||||
|
||||
Logging is **quiet by default**: only the startup banner ("Teams Status
|
||||
Keeper started…") and any error from an unhandled rejection print on a
|
||||
@@ -140,21 +152,49 @@ sweep. The script controls cadence itself via `config.stepDelay`, so the
|
||||
implicit delay is disabled at module load (a side effect of importing
|
||||
`keeper.ts`).
|
||||
|
||||
## For contributors
|
||||
|
||||
Clone the repo and bootstrap a dev environment:
|
||||
|
||||
```sh
|
||||
git clone https://gitea.cahlen.com/nokeo08/Move.git
|
||||
cd Move
|
||||
./dev-setup.sh
|
||||
```
|
||||
|
||||
`dev-setup.sh` verifies Bun is installed and runs `bun install` (with
|
||||
devDependencies, unlike the end-user `install.sh`).
|
||||
|
||||
Run from the source tree:
|
||||
|
||||
```sh
|
||||
bun run start # via the package.json script
|
||||
bun run src/move.ts # direct
|
||||
bun run src/move.ts --help
|
||||
```
|
||||
|
||||
Or install a global `move` pointed at your checkout:
|
||||
|
||||
```sh
|
||||
bun link
|
||||
move --help
|
||||
```
|
||||
|
||||
## Files
|
||||
|
||||
| File | Purpose |
|
||||
| ------------------- | ----------------------------------------------------------------------- |
|
||||
| `src/move.ts` | CLI entry point: parses args, dispatches help/version, starts the loop. |
|
||||
| `src/cli.ts` | Argument parsing, validation, and help/version output. |
|
||||
| `src/config.ts` | `Config` type, `DEFAULT_CONFIG`, and `resolveConfig` overlay. |
|
||||
| `src/keeper.ts` | Synthetic-activity sweep and idle-watch loop. |
|
||||
| `install.sh` | Bootstrap: verify Bun, `bun install`, print macOS permission hint. |
|
||||
| `package.json` | Bun project manifest. Single runtime dep: `@nut-tree-fork/nut-js`. |
|
||||
| `tsconfig.json` | Strict TypeScript config tuned for Bun (ESNext, bundler resolution). |
|
||||
| `bun.lock` | Bun's lockfile. Commit this. |
|
||||
| `LICENSE` | GPLv3 license text. |
|
||||
| `CHANGES.md` | History of the post-port review fixes. |
|
||||
| `MouseMover.java` | Original Java source, kept for reference. |
|
||||
| File | Purpose |
|
||||
| ------------------- | ----------------------------------------------------------------------------- |
|
||||
| `install.sh` | End-user installer; curl-pipeable from Gitea. |
|
||||
| `uninstall.sh` | End-user uninstaller; curl-pipeable from Gitea. |
|
||||
| `dev-setup.sh` | Contributor bootstrap (verify Bun + `bun install`). |
|
||||
| `src/move.ts` | CLI entry point: parses args, dispatches help/version, starts the loop. |
|
||||
| `src/cli.ts` | Argument parsing, validation, and help/version output. |
|
||||
| `src/config.ts` | `Config` type, `DEFAULT_CONFIG`, and `resolveConfig` overlay. |
|
||||
| `src/keeper.ts` | Synthetic-activity sweep and idle-watch loop. |
|
||||
| `package.json` | Bun project manifest. Single runtime dep: `@nut-tree-fork/nut-js`. |
|
||||
| `tsconfig.json` | Strict TypeScript config tuned for Bun (ESNext, bundler resolution). |
|
||||
| `bun.lock` | Bun's lockfile. Commit this. |
|
||||
| `LICENSE` | GPLv3 license text. |
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user