New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

get-shell-vars

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-shell-vars - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

28

lib/index.js

@@ -9,22 +9,2 @@ "use strict";

// Correct order for Login shells is described here:
// http://hayne.net/MacDev/Notes/unixFAQ.html#shellStartup
const profileOrder = [
".bash_profile",
".bash_login",
".profile",
".bashrc"
];
const getPathToProfile = (shell) => {
let currentProfileOrder = profileOrder.map(p => p.replace("bash", shell)) // in case the default shell is not bash
.map(p => path.join(process.env.HOME, p));
for (let profileName of currentProfileOrder) {
if (fs.existsSync(profileName)) {
return profileName;
}
}
};
const addEtcPathToPath = (environmentVariables) => {

@@ -63,10 +43,4 @@ const pathToEtcPath = "/etc/paths";

const profileName = getPathToProfile(shell);
if (!profileName) {
return addEtcPathToPath(process.env);
}
try {
const sourcedEnvironmentVars = childProcess.execSync(`${pathToShell} -c "source ${profileName} && env"`);
const sourcedEnvironmentVars = childProcess.execSync(`${pathToShell} -ilc env`);

@@ -73,0 +47,0 @@ if (sourcedEnvironmentVars) {

@@ -0,0 +0,0 @@ "use strict";

2

package.json
{
"name": "get-shell-vars",
"version": "1.1.1",
"version": "1.2.0",
"description": "Code that sources correct profiles, so that you can use all Environment variables declared in them.",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -0,0 +0,0 @@ # get-shell-vars

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc