Fix bin/publish: use correct .env path for rspade_system Fix bin/publish script: prevent grep exit code 1 from terminating script 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
27 lines
554 B
JavaScript
Executable File
27 lines
554 B
JavaScript
Executable File
const File = require('./File');
|
|
const Paths = require('./Paths');
|
|
|
|
class PackageManager {
|
|
static detect() {
|
|
const execPath = process.env.npm_execpath || '';
|
|
|
|
if (
|
|
execPath.endsWith('yarn.js') ||
|
|
execPath.endsWith('yarn') ||
|
|
PackageManager.hasYarnLockFile()
|
|
) {
|
|
return 'yarn';
|
|
}
|
|
|
|
return 'npm';
|
|
}
|
|
|
|
static hasYarnLockFile() {
|
|
const paths = new Paths();
|
|
|
|
return File.exists(paths.root('yarn.lock'));
|
|
}
|
|
}
|
|
|
|
module.exports = PackageManager;
|