@joddabod5scripts/pokemon-fastfetch 1.0.2 → 1.0.4

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.
Files changed (2) hide show
  1. package/bin/index.js +13 -17
  2. package/package.json +2 -2
package/bin/index.js CHANGED
@@ -94,12 +94,13 @@ function ensureConfig() {
94
94
  }
95
95
 
96
96
  function checkFastfetch() {
97
- const result = spawnSync('which', ['fastfetch'], { encoding: 'utf8' });
98
- if (result.error || result.status !== 0) {
99
- console.error(
100
- 'fastfetch is not installed. To install it:\n'
101
- );
102
- console.error(' Debian/Ubuntu: sudo apt install fastfetch\n');
97
+ // Using `command -v` works cross-platform on macOS, Linux, and BSD
98
+ const result = spawnSync('command', ['-v', 'fastfetch'], {
99
+ shell: true,
100
+ encoding: 'utf8',
101
+ });
102
+ if (result.status !== 0) {
103
+ console.error('fastfetch is not installed. To install it:\n');
103
104
  console.error(' macOS: brew install fastfetch\n');
104
105
  console.error(' Arch: sudo pacman -S fastfetch\n');
105
106
  return 1;
@@ -108,17 +109,12 @@ function checkFastfetch() {
108
109
  }
109
110
 
110
111
  function checkPokemonColorscripts() {
111
- const result = spawnSync('which', ['pokemon-colorscripts'], { encoding: 'utf8' });
112
- if (result.error || result.status !== 0) {
113
- console.error(
114
- 'pokemon-colorscripts is not installed. To install it:\n'
115
- );
116
- console.error(
117
- ' git clone https://gitlab.com/phoneybadger/pokemon-colorscripts.git\n'
118
- );
119
- console.error(' cd pokemon-colorscripts\n');
120
- console.error(' sudo ./install.sh\n');
121
- console.error('Then verify the install by running: pokemon-colorscripts\n');
112
+ const result = spawnSync('command', ['-v', 'pokemon-colorscripts'], {
113
+ shell: true,
114
+ encoding: 'utf8',
115
+ });
116
+ if (result.status !== 0) {
117
+ console.error('pokemon-colorscripts is not installed.\n');
122
118
  return 1;
123
119
  }
124
120
  return 0;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@joddabod5scripts/pokemon-fastfetch",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "bin": {
5
- "pokemon-fastfetch": "./bin/index.js"
5
+ "pokemon-fastfetch": "bin/index.js"
6
6
  },
7
7
  "preferGlobal": false
8
8
  }