Skip to content

Commit

Permalink
Rework standalone mode
Browse files Browse the repository at this point in the history
Instead of being a single executable script, it's an extractable zip. Making a single file will require a bundler which is too much work right now.
  • Loading branch information
warriordog committed Jun 16, 2022
1 parent 18d084d commit f8fe4f7
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .idea/little-log-scan.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Lines are read from standard input, and any matches are written to standard outp
* Through npx: `npx little-log-scan [options]`
* Through npm: `npm install little-log-scan && npm run cli -- [options]`
* Standalone:
* ~~Linux - `./little-log-scan.sh [options]`~~ Not implemented yet
* ~~Windows - `./little-log-scan.bat [options]`~~ Not implemented yet
* ~~Anything - `node ./little-log-scan.js [options]`~~ Not implemented yet
* Linux - `./little-log-scan.sh [options]`
* Windows - `./little-log-scan.bat [options]`
* Anything - `node ./bin/cli [options]`

## Examples
* Standard usage (default settings): `cat some.log | little-log-scan`
Expand Down
Empty file modified bin/cli
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions little-log-scan.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
node bin/cli %*
2 changes: 2 additions & 0 deletions little-log-scan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
node bin/cli "$@"
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build-package": "tsc -b",
"build-script": "echo \"Error: script build not implemented\" && exit 1",
"build": "tsc -b",
"build-standalone": "npm run build && util/dist-standalone.sh",
"cli": "tsc -b && node bin/cli",
"prepublish": "tsc -b"
"prepublish": "npm run build"
},
"keywords": [ "scan", "log" ],
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"incremental": true,
"esModuleInterop": true,

"outDir": "dist/package",
"outDir": "./dist/package",
"sourceMap": true,
"inlineSources": true,
"forceConsistentCasingInFileNames": true,
Expand Down
19 changes: 19 additions & 0 deletions util/dist-standalone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# Get path to output
DIST_ARCHIVE=./dist/standalone/little-log-scan.zip

# Delete if it already exists
if [[ -f "$DIST_ARCHIVE" ]]; then
rm -f "$DIST_ARCHIVE"
fi

# Zip up current build
7z a -tZIP "$DIST_ARCHIVE" \
dist/package/ \
bin/ \
LICENSE \
CHANGES.md \
README.md \
little-log-scan.sh \
little-log-scan.bat

0 comments on commit f8fe4f7

Please sign in to comment.