diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5f2e203 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.sh text eol=lf +*.ps1 text eol=crlf +*.bat text eol=crlf diff --git a/README.md b/README.md index d402e6c..ed96fd6 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ A lightweight, fast and multi-functional desktop text editor for Windows, macOS - [Features](#features) - [Keyboard shortcuts](#keyboard-shortcuts) - [Supported languages](#supported-languages) +- [Install from source](#install-from-source) - [Getting started](#getting-started) - [Building installers](#building-installers) - [Development](#development) @@ -140,11 +141,59 @@ Syntax highlighting is chosen from the file name or extension, and can be change Plain text, JavaScript, TypeScript, JSON, XML, HTML, CSS, YAML, Markdown, Java, Kotlin, C/C++, C#, Go, Rust, Python, Ruby, PHP, SQL, PL/SQL, Shell, Batch, PowerShell, INI, Properties, TOML, Dockerfile and Makefile. +## Install from source + +The `install/` folder has a script per operating system that builds Note Manager from this repository and installs it. Each script checks for Git and Node.js 22.17+ or 24+, runs `npm ci` and builds a clean `out/` folder, installs the result over any earlier installation and starts the app. Close Note Manager before running one. + +| System | Script | What it installs | +|---|---|---| +| Windows | `install\install-windows.bat` (or `install\install-windows.ps1`) | Builds the Squirrel installer with `npm run make` and runs it, which installs the app for the current user | +| macOS | `install/install-macos.sh` | Builds the DMG and ZIP with `npm run make` and copies `Note Manager.app` into `/Applications` (or `~/Applications` when `/Applications` is not writable) | +| Linux | `install/install-linux.sh` | On Debian and Ubuntu, builds the DEB package with `npm run make` and installs it with `apt` (installing `fakeroot` first when it is missing). On other distributions, builds the app with `npm run package` and installs it for the current user in `~/.local/share/note-manager`, with `~/.local/bin/note-manager` and a desktop entry | + +`install/linux_clean_install.sh` is kept for existing users and runs `install-linux.sh`. + +From a clone, run the script for your system: + +```bash +git clone https://github.com/Note-Manager/note-manager +cd note-manager +./install/install-linux.sh # or ./install/install-macos.sh +``` + +```bat +git clone https://github.com/Note-Manager/note-manager +cd note-manager +install\install-windows.bat +``` + +A script can also be downloaded on its own. It then clones the repository into `~/note-manager` (`%USERPROFILE%\note-manager` on Windows), or updates that clone when it already exists, and builds it: + +```bash +curl -fsSL https://raw.githubusercontent.com/Note-Manager/note-manager/main/install/install-linux.sh | bash +curl -fsSL https://raw.githubusercontent.com/Note-Manager/note-manager/main/install/install-macos.sh | bash +``` + +```powershell +Invoke-WebRequest https://raw.githubusercontent.com/Note-Manager/note-manager/main/install/install-windows.ps1 -OutFile install-windows.ps1 +powershell -ExecutionPolicy Bypass -File .\install-windows.ps1 +``` + +Options: + +| Shell scripts | PowerShell | Meaning | +|---|---|---| +| `--dir ` | `-Dir ` | Where to clone the repository when the script is not run from a clone (default `~/note-manager`) | +| `--ref ` | `-Ref ` | Branch or tag to build (default `main` for a clone the script made; a clone the script runs from keeps its current branch) | +| `--help` | `-Help` | Show the usage | + +Options go after `bash -s --` when the script is piped, for example `curl -fsSL