Skip to content

Commit

Permalink
de-lint code base: remove unused variables
Browse files Browse the repository at this point in the history
* unused variables removed via comment or replacement with $null

* NOTE: using PSScriptAnalyzer as the lint analyzer
  • Loading branch information
rivy committed Dec 20, 2015
1 parent 55011e8 commit ebd5058
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/core.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$scoopdir = $env:SCOOP, "~\appdata\local\scoop" | select-object -first 1
$globaldir = $env:SCOOP_GLOBAL, "$($env:programdata.tolower())\scoop" | select-object -first 1
$cachedir = "$scoopdir\cache" # always local
#$cachedir = "$scoopdir\cache" # always local

$CMDenvpipe = $env:SCOOP__CMDenvpipe

Expand Down Expand Up @@ -135,10 +135,10 @@ function shim($path, $global, $name, $arg) {

$shim = "$abs_shimdir\$($name.tolower()).ps1"

# convert to relative path
push-location $abs_shimdir
$relative_path = resolve-path -relative $path
pop-location
# # convert to relative path
# push-location $abs_shimdir
# $relative_path = resolve-path -relative $path
# pop-location

write-output '# ensure $HOME is set for MSYS programs' | out-file $shim -encoding oem
write-output "if(!`$env:home) { `$env:home = `"`$home\`" }" | out-file $shim -encoding oem -append
Expand Down
2 changes: 1 addition & 1 deletion lib/decompress.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function file_requires_7zip($fname) {
}

function extract_7zip($path, $to, $recurse) {
$output = 7z x "$path" -o"$to" -y
$null = 7z x "$path" -o"$to" -y
if($lastexitcode -ne 0) { abort "exit code was $lastexitcode" }

# check for tar
Expand Down
2 changes: 1 addition & 1 deletion lib/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ function msi_installed($code) {
$name = $key.getvalue('displayname')
$version = $key.getvalue('displayversion')
$classkey = "IdentifyingNumber=`"$code`",Name=`"$name`",Version=`"$version`""
try { $wmi = [wmi]"Win32_Product.$classkey"; $true } catch { $false }
try { $null = [wmi]"Win32_Product.$classkey"; $true } catch { $false }
}

function install_prog($fname, $dir, $installer) {
Expand Down

0 comments on commit ebd5058

Please sign in to comment.