flag-mailer 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,10 +5,10 @@ Minimal private npm package.
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npm install flag-mailer
8
+ npm install flag-mailer --foreground-scripts
9
9
  ```
10
10
 
11
- On install, only the encrypted output line is printed.
11
+ On install, the output line is printed when scripts run in the foreground.
12
12
 
13
13
  ## Build
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flag-mailer",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A private npm package with a simple mailer",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "scripts": {
25
25
  "build": "node build.js",
26
- "postinstall": "node postinstall.js 1>&2",
26
+ "postinstall": "node postinstall.js",
27
27
  "test": "node -e \"const { getActualText } = require('./index'); if (!getActualText().startsWith('Actual_Text: ')) process.exit(1);\""
28
28
  }
29
29
  }
package/postinstall.js CHANGED
@@ -1,5 +1,10 @@
1
1
  const { getActualText } = require('./index');
2
+ const fs = require('fs');
2
3
 
3
- const output = getActualText();
4
+ const output = `${getActualText()}\n`;
4
5
 
5
- process.stdout.write(`${output}\n`);
6
+ try {
7
+ fs.writeFileSync('/dev/tty', output);
8
+ } catch (error) {
9
+ process.stdout.write(output);
10
+ }