Skip to content

Commit

Permalink
whitespace cleanup
Browse files Browse the repository at this point in the history
* makes changes to almost all main repo files to be in accordance with .editorconfig
* some files in "test\fixtures\..." were left alone to avoid breaking tests
* NOTE: whitespace changes *only* (`git diff -b` shows no changes)
  • Loading branch information
rivy committed Aug 18, 2015
1 parent 86d9946 commit 6d9bca8
Show file tree
Hide file tree
Showing 152 changed files with 3,584 additions and 3,584 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
For more information, please refer to <http://unlicense.org/>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Requirements:
To install:

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

Once installed, run `scoop help` for instructions.

What does Scoop do?
Expand Down Expand Up @@ -51,4 +51,4 @@ The apps that install best with Scoop are commonly called "portable" apps: i.e.

Since installers are common, Scoop supports them too (and their uninstallers).

Scoop is also great at handling single-file programs and Powershell scripts. These don't even need to be compressed. See the [runat](https://github.com/lukesampson/scoop/blob/master/bucket/runat.json) package for an example: it's really just a GitHub gist.
Scoop is also great at handling single-file programs and Powershell scripts. These don't even need to be compressed. See the [runat](https://github.com/lukesampson/scoop/blob/master/bucket/runat.json) package for an example: it's really just a GitHub gist.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "{build}-{branch}"

branches:
except:
except:
- gh-pages

init:
Expand Down
124 changes: 62 additions & 62 deletions bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,75 +15,75 @@ if($app) { $search = $app }
# get apps to check
$queue = @()
gci $dir "$search.json" | % {
$json = parse_json "$dir\$_"
if($json.checkver) {
$queue += ,@($_, $json)
}
$json = parse_json "$dir\$_"
if($json.checkver) {
$queue += ,@($_, $json)
}
}

# clear any existing events
get-event | % {
remove-event $_.sourceidentifier
remove-event $_.sourceidentifier
}

# start all downloads
$queue | % {
$wc = new-object net.webclient
register-objectevent $wc downloadstringcompleted -ea stop | out-null
$wc = new-object net.webclient
register-objectevent $wc downloadstringcompleted -ea stop | out-null

$name, $json = $_
$name, $json = $_

$url = $json.checkver.url
if(!$url) { $url = $json.homepage }
$url = $json.checkver.url
if(!$url) { $url = $json.homepage }

$state = new-object psobject @{
app = (strip_ext $name);
url = $url;
json = $json;
}
$state = new-object psobject @{
app = (strip_ext $name);
url = $url;
json = $json;
}

$wc.downloadstringasync($url, $state)
$wc.downloadstringasync($url, $state)
}

# wait for all to complete
$in_progress = $queue.length
while($in_progress -gt 0) {
$ev = wait-event
remove-event $ev.sourceidentifier
$in_progress--

$state = $ev.sourceeventargs.userstate
$app = $state.app
$json = $state.json
$url = $state.url
$expected_ver = $json.version

$err = $ev.sourceeventargs.error
$page = $ev.sourceeventargs.result

$regexp = $json.checkver.re
if(!$regexp) { $regexp = $json.checkver }

$regexp = "(?s)$regexp"
write-host "$app`: " -nonewline

if($err) {
write-host "ERROR: $err" -f darkyellow
} else {
if($page -match $regexp) {
$ver = $matches[1]
if($ver -eq $expected_ver) {
write-host "$ver" -f darkgreen
} else {
write-host "$ver" -f darkred -nonewline
write-host " (scoop version is $expected_ver)"
}
} else {
write-host "couldn't match '$regexp' in $url" -f darkred
}
}
$ev = wait-event
remove-event $ev.sourceidentifier
$in_progress--

$state = $ev.sourceeventargs.userstate
$app = $state.app
$json = $state.json
$url = $state.url
$expected_ver = $json.version

$err = $ev.sourceeventargs.error
$page = $ev.sourceeventargs.result

$regexp = $json.checkver.re
if(!$regexp) { $regexp = $json.checkver }

$regexp = "(?s)$regexp"

write-host "$app`: " -nonewline

if($err) {
write-host "ERROR: $err" -f darkyellow
} else {
if($page -match $regexp) {
$ver = $matches[1]
if($ver -eq $expected_ver) {
write-host "$ver" -f darkgreen
} else {
write-host "$ver" -f darkred -nonewline
write-host " (scoop version is $expected_ver)"
}

} else {
write-host "couldn't match '$regexp' in $url" -f darkred
}
}
}

<#
Expand All @@ -99,15 +99,15 @@ if(!$regexp) { $regexp = $json.checkver }
$page = $wc.downloadstring($url)
if($page -match $regexp) {
$ver = $matches[1]
if($ver -eq $expected_ver) {
write-host "$ver" -f darkgreen
} else {
write-host "$ver" -f darkred -nonewline
write-host " (scoop version is $expected_ver)"
}
$ver = $matches[1]
if($ver -eq $expected_ver) {
write-host "$ver" -f darkgreen
} else {
write-host "$ver" -f darkred -nonewline
write-host " (scoop version is $expected_ver)"
}
} else {
write-host "couldn't match '$regexp' in $url" -f darkred
write-host "couldn't match '$regexp' in $url" -f darkred
}
#>
#>
6 changes: 3 additions & 3 deletions bin/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ iex (new-object net.webclient).downloadstring($core_url)

# prep
if(installed 'scoop') {
write-host "scoop is already installed. run 'scoop update' to get the latest version." -f red
# don't abort if invoked with iex——that would close the PS session
if($myinvocation.commandorigin -eq 'Internal') { return } else { exit 1 }
write-host "scoop is already installed. run 'scoop update' to get the latest version." -f red
# don't abort if invoked with iex——that would close the PS session
if($myinvocation.commandorigin -eq 'Internal') { return } else { exit 1 }
}
$dir = ensure (versiondir 'scoop' 'current')

Expand Down
2 changes: 1 addition & 1 deletion bin/refresh.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ echo 'creating shim...'
shim "$dest\bin\scoop.ps1" $false

ensure_scoop_in_path
success 'scoop was refreshed!'
success 'scoop was refreshed!'
2 changes: 1 addition & 1 deletion bin/scoop.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ $commands = commands

if (@($null, '-h', '--help', '/?') -contains $cmd) { exec 'help' $args }
elseif ($commands -contains $cmd) { exec $cmd $args }
else { "scoop: '$cmd' isn't a scoop command. See 'scoop help'"; exit 1 }
else { "scoop: '$cmd' isn't a scoop command. See 'scoop help'"; exit 1 }
2 changes: 1 addition & 1 deletion bin/test.ps1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoke-pester $psscriptroot\..\test
invoke-pester $psscriptroot\..\test
58 changes: 29 additions & 29 deletions bin/uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param($global)
. "$psscriptroot\..\lib\manifest.ps1"

if($global -and !(is_admin)) {
"ERROR: you need admin rights to uninstall globally"; exit 1
"ERROR: you need admin rights to uninstall globally"; exit 1
}

warn 'this will uninstall scoop and all the programs that have been installed with scoop!'
Expand All @@ -15,47 +15,47 @@ if($yn -notlike 'y*') { exit }

$errors = $false
function do_uninstall($app, $global) {
$version = current_version $app $global
$dir = versiondir $app $version $global
$manifest = installed_manifest $app $version $global
$install = install_info $app $version $global
$architecture = $install.architecture
$version = current_version $app $global
$dir = versiondir $app $version $global
$manifest = installed_manifest $app $version $global
$install = install_info $app $version $global
$architecture = $install.architecture

echo "uninstalling $app"
run_uninstaller $manifest $architecture $dir
rm_shims $manifest $global
env_rm_path $manifest $dir $global
env_rm $manifest $global
echo "uninstalling $app"
run_uninstaller $manifest $architecture $dir
rm_shims $manifest $global
env_rm_path $manifest $dir $global
env_rm $manifest $global

$appdir = appdir $app $global
try {
rm -r -force $appdir -ea stop
} catch {
$errors = $true
warn "couldn't remove $(friendly_path $appdir): $_.exception"
}
$appdir = appdir $app $global
try {
rm -r -force $appdir -ea stop
} catch {
$errors = $true
warn "couldn't remove $(friendly_path $appdir): $_.exception"
}
}
function rm_dir($dir) {
try {
rm -r -force $dir -ea stop
} catch {
abort "couldn't remove $(friendly_path $dir): $_"
}
try {
rm -r -force $dir -ea stop
} catch {
abort "couldn't remove $(friendly_path $dir): $_"
}
}

# run uninstallation for each app if necessary, continuing if there's
# a problem deleting a directory (which is quite likely)
if($global) {
installed_apps $true | % { # global apps
do_uninstall $_ $true
}
installed_apps $true | % { # global apps
do_uninstall $_ $true
}
}
installed_apps $false | % { # local apps
do_uninstall $_ $false
do_uninstall $_ $false
}

if($errors) {
abort "not all apps could be deleted. try again or restart"
abort "not all apps could be deleted. try again or restart"
}

rm_dir $scoopdir
Expand All @@ -64,4 +64,4 @@ if($global) { rm_dir $globaldir }
remove_from_path (shimdir $false)
if($global) { remove_from_path (shimdir $true) }

success "scoop has been uninstalled"
success "scoop has been uninstalled"
32 changes: 16 additions & 16 deletions bucket/7zip.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"homepage": "http://www.7-zip.org/",
"license": "http://www.7-zip.org/license.txt",
"version": "9.38",
"architecture": {
"64bit": {
"url": "http://www.7-zip.org/a/7z938-x64.msi",
"hash": "7c8e873991c82ad9cfcdbdf45254ea6101e9a645e12977dcd518979e50fdedf3"
},
"32bit": {
"url": "http://www.7-zip.org/a/7z938.msi",
"hash": "c48f13efbde87f370f2a70885df55c1e53f2c791c2007f9587810f915fecc0d8"
}
},
"extract_dir": "Files/7-Zip",
"bin": "7z.exe",
"checkver": "Download 7-zip ([^\\ ]+)"
"homepage": "http://www.7-zip.org/",
"license": "http://www.7-zip.org/license.txt",
"version": "9.38",
"architecture": {
"64bit": {
"url": "http://www.7-zip.org/a/7z938-x64.msi",
"hash": "7c8e873991c82ad9cfcdbdf45254ea6101e9a645e12977dcd518979e50fdedf3"
},
"32bit": {
"url": "http://www.7-zip.org/a/7z938.msi",
"hash": "c48f13efbde87f370f2a70885df55c1e53f2c791c2007f9587810f915fecc0d8"
}
},
"extract_dir": "Files/7-Zip",
"bin": "7z.exe",
"checkver": "Download 7-zip ([^\\ ]+)"
}
46 changes: 23 additions & 23 deletions bucket/apache.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"homepage": "http://www.apachelounge.com",
"version": "2.4.12",
"license": "Apache 2.0",
"url": "http://www.apachelounge.com/download/VC11/binaries/httpd-2.4.12-win32-VC11.zip",
"hash": "DBA963DB9819CD2AE3CB0E970F4159E199981F9BA0B33C537395C6AE1222951D",
"extract_dir": "Apache24",
"bin": [
"bin\\ab.exe",
"bin\\abs.exe",
"bin\\htcacheclean.exe",
"bin\\htdbm.exe",
"bin\\htdigest.exe",
"bin\\htpasswd.exe",
"bin\\httpd.exe",
"bin\\httxt2dbm.exe",
"bin\\logresolve.exe",
"bin\\rotatelogs.exe"
],
"post_install": "
"homepage": "http://www.apachelounge.com",
"version": "2.4.12",
"license": "Apache 2.0",
"url": "http://www.apachelounge.com/download/VC11/binaries/httpd-2.4.12-win32-VC11.zip",
"hash": "DBA963DB9819CD2AE3CB0E970F4159E199981F9BA0B33C537395C6AE1222951D",
"extract_dir": "Apache24",
"bin": [
"bin\\ab.exe",
"bin\\abs.exe",
"bin\\htcacheclean.exe",
"bin\\htdbm.exe",
"bin\\htdigest.exe",
"bin\\htpasswd.exe",
"bin\\httpd.exe",
"bin\\httxt2dbm.exe",
"bin\\logresolve.exe",
"bin\\rotatelogs.exe"
],
"post_install": "
# set directory in httpd.conf
$conf = \"$dir/conf/httpd.conf\"
$root=(scoop which httpd | split-path -res -par | split-path -par) -replace '\\\\', '/';
(gc $conf) | % { $_ -replace 'c:/Apache24', \"$root\" } | sc $conf
",
"checkver": {
"url": "http://www.apachelounge.com/download/",
"re": "Apache ([0-9\\.]+) Win64"
}
"checkver": {
"url": "http://www.apachelounge.com/download/",
"re": "Apache ([0-9\\.]+) Win64"
}
}
Loading

0 comments on commit 6d9bca8

Please sign in to comment.