Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
Signed-off-by: Zvi Grinberg <zgrinber@redhat.com>
  • Loading branch information
zvigrinberg committed Jul 10, 2024
1 parent d900760 commit 3861ed2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions src/providers/javascript_npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ export var npmInteractions = {
createPackageLock: function createPackageLock(npm, manifestDir) {
// in windows os, --prefix flag doesn't work, it behaves really weird , instead of installing the package.json fromm the prefix folder,
// it's installing package.json (placed in current working directory of process) into prefix directory, so
let originalDir = process.cwd()
if(os.platform() === 'win32') {
process.chdir(manifestDir)
}
let originalDir = process.cwd()
if(os.platform() === 'win32') {
process.chdir(manifestDir)
}
execSync(`${handleSpacesInPath(npm)} i --package-lock-only --prefix ${handleSpacesInPath(manifestDir)}`, err => {
if (err) {
throw new Error('failed to create npmOutput list')
}
})
if(os.platform() === 'win32') {
process.chdir(originalDir)
}
if(os.platform() === 'win32') {
process.chdir(originalDir)
}
}
}
export default { isSupported, provideComponent, provideStack, npmInteractions }
Expand Down
12 changes: 6 additions & 6 deletions src/providers/python_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ export default class Python_controller {
this.pathToPipBin = path.join(path.sep,this.pythonEnvDir,os.platform() === 'win32' ? "Scripts" : "bin",this.#decideIfWindowsOrLinuxPath("pip3"))
this.pathToPythonBin = path.join(path.sep,this.pythonEnvDir,os.platform() === 'win32' ? "Scripts" : "bin",this.#decideIfWindowsOrLinuxPath("python3"))
if(os.platform() === 'win32') {
let driveLetter = path.parse(process.cwd()).root
this.pathToPythonBin = `${driveLetter}${this.pathToPythonBin.substring(1)}`
this.pathToPipBin = `${driveLetter}${this.pathToPipBin.substring(1)}`
let driveLetter = path.parse(process.cwd()).root
this.pathToPythonBin = `${driveLetter}${this.pathToPythonBin.substring(1)}`
this.pathToPipBin = `${driveLetter}${this.pathToPipBin.substring(1)}`
}
}
else {
this.pathToPipBin = path.join(path.sep,this.pythonEnvDir,os.platform() === 'win32' ? "Scripts" : "bin",this.#decideIfWindowsOrLinuxPath("pip"));
this.pathToPythonBin = path.join(path.sep,this.pythonEnvDir,os.platform() === 'win32' ? "Scripts" : "bin",this.#decideIfWindowsOrLinuxPath("python"))
if(os.platform() === 'win32') {
let driveLetter = path.parse(process.cwd()).root
this.pathToPythonBin = `${driveLetter}${this.pathToPythonBin.substring(1)}`
this.pathToPipBin = `${driveLetter}${this.pathToPipBin.substring(1)}`
let driveLetter = path.parse(process.cwd()).root
this.pathToPythonBin = `${driveLetter}${this.pathToPythonBin.substring(1)}`
this.pathToPipBin = `${driveLetter}${this.pathToPipBin.substring(1)}`
}
}
// upgrade pip version to latest
Expand Down

0 comments on commit 3861ed2

Please sign in to comment.