Skip to content

Commit

Permalink
Fix #80 mt as binary
Browse files Browse the repository at this point in the history
  • Loading branch information
boly38 committed Apr 20, 2024
1 parent 6c88439 commit 9203504
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 deletions.
9 changes: 5 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ export GREN_GITHUB_TOKEN=your_token_here
# one time setup
npm install github-release-notes -g

# make a release v1.0.1 with all history
gren release --data-source=prs -t "v1.0.1" --milestone-match="v1.0.1"
# overrides release v1.0.1 with history from v1.0.0
gren release --data-source=prs -t "v1.0.1..v1.0.0" --milestone-match="v1.0.1" --override
git fetch --all && git pull
# make a release vX with all history
gren release --data-source=prs -t v2.2.2 --milestone-match=v2.2.2
# overrides release vX with history from vX-1
gren release --data-source=prs -t "v2.2.2..v2.2.1" --milestone-match="v2.2.2" --override
```
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,41 @@ From a GitHub Actions context, you can install them via [action-mongo-tools](htt


## Command line usage
You should decide to install it globally without getting source or by cloning repository.

### Initial setup - first time only
### Install globally (beta)
```bash
npm install -g node-mongotools@latest
```
# get source code
When using a global install `mt` command must be directly available (ie. you can replace `node mt` by `mt` in examples).

### Install by getting source
```bash
git clone https://github.com/boly38/node-mongotools.git
# install dependencies
npm install
```

### Environment setup - first time only
```bash
#~ setup environment variables
cp env/initEnv.template.sh env/initEnv.dontpush.sh
# you must update env/initEnv.dontpush.sh
```

### Set your preferences
```
# source your options
source your options
```bash
. ./env/initEnv.dontpush.sh
```

### Basic feature
```bash
# create a mongo dump
node mt dump
# or if you rely on a global install
# mt dump
# apply the same logic for next examples

# create a encrypted mongo dump
node mt dumpz
Expand Down
15 changes: 15 additions & 0 deletions bin/mt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env node

import {MTCommand} from '../lib/mt.js'; // as library client you may use : import { MongoTools, MTOptions, MTCommand } from "node-mongotools";
import process from "node:process";

// take first command line argument
const action = process.argv.slice(2)[0];

(new MTCommand()).doAction(action);






2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"type": "module",
"main": "./lib/mt.js",
"bin": "./mt.js",
"bin": "./bin/mt.js",
"scripts": {
"lint": "eslint .",
"audit": "npm audit --omit=dev",
Expand Down

0 comments on commit 9203504

Please sign in to comment.