🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@getnote/cli

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@getnote/cli - npm Package Compare versions

Comparing version
1.0.1
to
1.0.2
+1
-1
package.json
{
"name": "@getnote/cli",
"version": "1.0.1",
"version": "1.0.2",
"description": "CLI tool for Get笔记 — manage notes and knowledge bases from the terminal",

@@ -5,0 +5,0 @@ "keywords": [

@@ -77,2 +77,5 @@ #!/usr/bin/env node

console.log(`getnote installed at ${binaryPath}`);
// Create symlink in npm global bin directory so `getnote` is on PATH
createSymlink(binaryPath, binaryName);
} catch (err) {

@@ -87,1 +90,21 @@ console.error('Failed to install getnote:', err.message);

main();
// Create a symlink in the npm global bin directory after download.
// npm only creates the symlink at install time when the file already exists;
// since we download the binary in postinstall, we need to do it ourselves.
function createSymlink(binaryPath, binaryName) {
try {
const npmPrefix = execSync('npm prefix -g', { encoding: 'utf8' }).trim();
const globalBin = path.join(npmPrefix, 'bin');
const symlinkPath = path.join(globalBin, binaryName);
if (fs.existsSync(globalBin)) {
try { fs.unlinkSync(symlinkPath); } catch (_) {}
fs.symlinkSync(binaryPath, symlinkPath);
console.log(`Symlink created: ${symlinkPath} -> ${binaryPath}`);
}
} catch (err) {
// Non-fatal: user can run the binary directly or add it to PATH manually
console.warn(`Could not create symlink (you may need to add ${path.dirname(binaryPath)} to PATH): ${err.message}`);
}
}