@joddabod5scripts/pokemon-fastfetch 1.0.3 → 1.0.5

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 +4 -11
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -94,12 +94,8 @@ function ensureConfig() {
94
94
  }
95
95
 
96
96
  function checkFastfetch() {
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) {
97
+ const result = spawnSync('which', ['fastfetch'], { encoding: 'utf8' });
98
+ if (result.error || result.status !== 0) {
103
99
  console.error('fastfetch is not installed. To install it:\n');
104
100
  console.error(' macOS: brew install fastfetch\n');
105
101
  console.error(' Arch: sudo pacman -S fastfetch\n');
@@ -109,11 +105,8 @@ function checkFastfetch() {
109
105
  }
110
106
 
111
107
  function checkPokemonColorscripts() {
112
- const result = spawnSync('command', ['-v', 'pokemon-colorscripts'], {
113
- shell: true,
114
- encoding: 'utf8',
115
- });
116
- if (result.status !== 0) {
108
+ const result = spawnSync('which', ['pokemon-colorscripts'], { encoding: 'utf8' });
109
+ if (result.error || result.status !== 0) {
117
110
  console.error('pokemon-colorscripts is not installed.\n');
118
111
  return 1;
119
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joddabod5scripts/pokemon-fastfetch",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "bin": {
5
5
  "pokemon-fastfetch": "bin/index.js"
6
6
  },