From 2ed81dc1703ae0eeab6417e0f1ac91aaf2dfc133 Mon Sep 17 00:00:00 2001 From: Daniel Wu Date: Sun, 24 Sep 2023 21:53:25 -0400 Subject: [PATCH 1/2] update readme --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d2b4c16..599cd5a 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,22 @@ # dlp-cli installation -## Unix installation (Linux, MacOS) +## Unix installation (Linux, MacOS, WSL) -Step 1: Install homebrew (homebrew only works on mac and linux, so windows users may need WSL, may look into supporting winget in the future). You can find installation instructions for homebrew at [https://brew.sh/](https://brew.sh/) +Step 0: If on Windows, install [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) + +Step 1: Install homebrew. You can find installation instructions for homebrew at [https://brew.sh/](https://brew.sh/) Step 2: Run `brew tap DSGT-DLP/dlp-cli` in the terminal Step 3: Run `brew install dlp-cli` in the terminal -## Windows installation +## Windows installation (Do this if WSL doesn't work) + +Step 1: If you don't have the `dlp-cli` submodule, run `git submodule init dlp-cli` in the project directory. Then run `git submodule update`. If it says that you are in a detached HEAD state, cd to the dlp-cli submodule directory and `git checkout main`. -Step 1: If you don't have the `dlp-cli` submodule, run `git submodule init dlp-cli` in the project directory. Then run `git submodule update`. +Step 2: Run `winget settings --enable LocalManifestFiles` as administrator. Then, in the project directory, run `winget install -m dlp-cli/manifests/d/DSGT-DLP/dlp-cli/{version}`. Replace `{version}` with the version number that you want (typically the latest version). -Step 2: In the project directory, run `winget install -m dlp-cli/manifests/d/DSGT-DLP/dlp-cli/{version}`. Replace `{version}` with the version number that you want (typically the latest version). +Step 3: Add the path to the install location to your PATH environment variable (somewhere within `%localappdata%\microsoft\winget\packages`, may need file explorer to find the exact folder) ## Usage From 1333fe67b1802cc5382015bcb1435627f4d20b43 Mon Sep 17 00:00:00 2001 From: Daniel Wu Date: Wed, 27 Sep 2023 17:37:00 -0400 Subject: [PATCH 2/2] Add info about -w cmd --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 599cd5a..9323ca4 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Step 2: Run `brew tap DSGT-DLP/dlp-cli` in the terminal Step 3: Run `brew install dlp-cli` in the terminal +**NOTE (WSL):** You may need to append the `-w` flag to every cli command to tell dlp-cli to run bash cmds without pseudoterminals, which as of now only work in Unix environments. + ## Windows installation (Do this if WSL doesn't work) Step 1: If you don't have the `dlp-cli` submodule, run `git submodule init dlp-cli` in the project directory. Then run `git submodule update`. If it says that you are in a detached HEAD state, cd to the dlp-cli submodule directory and `git checkout main`. @@ -22,8 +24,15 @@ Step 3: Add the path to the install location to your PATH environment variable ( Run `dlp-cli` in DLP's project directory in the terminal -## Cli Development Info +## CLI Development Info -Run cli in debug mode with `go run main.go` +Run the cli in debug mode with `go run main.go` Make sure to add package paths of all files as imports in main.go + +## FAQs + +### panic: input/output error + +![input-output-error](https://github.com/DSGT-DLP/dlp-cli/assets/54150946/b9acfcca-4646-4086-9aea-e4f262520d87) +If you are on WSL, append the `-w` flag to tell the dlp-cli to run bash cmds without pseudoterminals, which are handled differently on windows and WSL. The way that the dlp-cli uses pseudoterminals currently only work in unix environments.