Skip to content

Commit

Permalink
Use sentence case for UI messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesampson committed Feb 13, 2017
1 parent 10df705 commit 1c173bc
Show file tree
Hide file tree
Showing 25 changed files with 171 additions and 172 deletions.
14 changes: 7 additions & 7 deletions bin/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ if((get-executionpolicy) -gt 'RemoteSigned') {

# get core functions
$core_url = 'https://raw.github.com/lukesampson/scoop/master/lib/core.ps1'
echo 'initializing...'
echo 'Initializing...'
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
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.mycommand.commandtype -eq 'Script') { return } else { exit 1 }
}
Expand All @@ -28,19 +28,19 @@ $dir = ensure (versiondir 'scoop' 'current')
# download scoop zip
$zipurl = 'https://github.com/lukesampson/scoop/archive/master.zip'
$zipfile = "$dir\scoop.zip"
echo 'downloading...'
echo 'Downloading...'
dl $zipurl $zipfile

'extracting...'
'Extracting...'
unzip $zipfile "$dir\_scoop_extract"
cp "$dir\_scoop_extract\scoop-master\*" $dir -r -force
rm "$dir\_scoop_extract" -r -force
rm $zipfile

echo 'creating shim...'
echo 'Creating shim...'
shim "$dir\bin\scoop.ps1" $false

ensure_robocopy_in_path
ensure_scoop_in_path
success 'scoop was installed successfully!'
echo "type 'scoop help' for instructions"
success 'Scoop was installed successfully!'
echo "Type 'scoop help' for instructions."
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 }
16 changes: 8 additions & 8 deletions bin/uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ 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!'
$yn = read-host 'are you sure? (yN)'
warn 'This will uninstall Scoop and all the programs that have been installed with Scoop!'
$yn = read-host 'Are you sure? (yN)'
if($yn -notlike 'y*') { exit }

$errors = $false
Expand All @@ -22,7 +22,7 @@ function do_uninstall($app, $global) {
$install = install_info $app $version $global
$architecture = $install.architecture

echo "uninstalling $app"
echo "Uninstalling $app"
run_uninstaller $manifest $architecture $dir
rm_shims $manifest $global $architecture

Expand All @@ -39,14 +39,14 @@ function do_uninstall($app, $global) {
rm -r -force $appdir -ea stop
} catch {
$errors = $true
warn "couldn't remove $(friendly_path $appdir): $_.exception"
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): $_"
abort "Couldn't remove $(friendly_path $dir): $_"
}
}

Expand All @@ -62,7 +62,7 @@ installed_apps $false | % { # local apps
}

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 @@ -71,4 +71,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."
2 changes: 1 addition & 1 deletion lib/config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ if($p) {
[net.webrequest]::defaultwebproxy.credentials = new-object net.networkcredential($user, $pass)
}
} catch {
warn "failed to use proxy '$p': $($_.exception.message)"
warn "Failed to use proxy '$p': $($_.exception.message)"
}
}
14 changes: 7 additions & 7 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ function unzip($path,$to) {
extract_7zip $path $to $false
return
} else {
abort "unzip failed: Windows can't handle the long paths in this zip file.`nrun 'scoop install 7zip' and try again."
abort "Unzip failed: Windows can't handle the long paths in this zip file.`nRun 'scoop install 7zip' and try again."
}
} catch {
abort "unzip failed: $_"
abort "Unzip failed: $_"
}
}
function unzip_old($path,$to) {
Expand All @@ -128,12 +128,12 @@ function movedir($from, $to) {

$out = robocopy "$from" "$to" /e /move
if($lastexitcode -ge 8) {
throw "error moving directory: `n$out"
throw "Error moving directory: `n$out"
}
}

function shim($path, $global, $name, $arg) {
if(!(test-path $path)) { abort "can't shim $(fname $path): couldn't find $path" }
if(!(test-path $path)) { abort "Can't shim $(fname $path): couldn't find $path" }
$abs_shimdir = ensure (shimdir $global)
if(!$name) { $name = strip_ext (fname $path) }

Expand Down Expand Up @@ -173,7 +173,7 @@ function ensure_in_path($dir, $global) {
$path = env 'path' $global
$dir = fullpath $dir
if($path -notmatch [regex]::escape($dir)) {
echo "adding $(friendly_path $dir) to $(if($global){'global'}else{'your'}) path"
echo "Adding $(friendly_path $dir) to $(if($global){'global'}else{'your'}) path."

env 'path' $global "$dir;$path" # for future sessions...
$env:path = "$dir;$env:path" # for this session
Expand All @@ -191,7 +191,7 @@ function remove_from_path($dir,$global) {
# future sessions
$was_in_path, $newpath = strip_path (env 'path' $global) $dir
if($was_in_path) {
echo "removing $(friendly_path $dir) from your path"
echo "Removing $(friendly_path $dir) from your path."
env 'path' $global $newpath
}

Expand Down Expand Up @@ -254,7 +254,7 @@ $default_aliases = @{
function reset_alias($name, $value) {
if($existing = get-alias $name -ea ignore |? { $_.options -match 'readonly' }) {
if($existing.definition -ne $value) {
write-host "alias $name is read-only; can't reset it" -f darkyellow
write-host "Alias $name is read-only; can't reset it." -f darkyellow
}
return # already set
}
Expand Down
2 changes: 1 addition & 1 deletion lib/decompress.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function file_requires_7zip($fname) {

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

# check for tar
$tar = (split-path $path -leaf) -replace '\.[^\.]*$', ''
Expand Down
4 changes: 2 additions & 2 deletions lib/depends.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ function dep_resolve($app, $arch, $resolved, $unresolved) {
$query = $app
$app, $bucket = app $query
$null, $manifest, $null, $null = locate $app $bucket
if(!$manifest) { abort "couldn't find manifest for $query" }
if(!$manifest) { abort "Couldn't find manifest for $query" }

$deps = @(install_deps $manifest $arch) + @(runtime_deps $manifest) | select -uniq

foreach($dep in $deps) {
if($resolved -notcontains $dep) {
if($unresolved -contains $dep) {
abort "circular dependency detected: $app -> $dep"
abort "Circular dependency detected: $app -> $dep"
}
dep_resolve $dep $arch $resolved $unresolved
}
Expand Down
8 changes: 4 additions & 4 deletions lib/getopt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ function getopt($argv, $shortopts, $longopts) {
if($longopt) {
if($longopt.endswith('=')) { # requires arg
if($i -eq $argv.length - 1) {
return err "option --$name requires an argument"
return err "Option --$name requires an argument."
}
$opts.$name = $argv[++$i]
} else {
$opts.$name = $true
}
} else {
return err "option --$name not recognized"
return err "Option --$name not recognized."
}
} elseif($arg.startswith('-') -and $arg -ne '-') {
for($j = 1; $j -lt $arg.length; $j++) {
Expand All @@ -54,14 +54,14 @@ function getopt($argv, $shortopts, $longopts) {
$shortopt = $matches[0]
if($shortopt[1] -eq ':') {
if($j -ne $arg.length -1 -or $i -eq $argv.length - 1) {
return err "option -$letter requires an argument"
return err "Option -$letter requires an argument."
}
$opts.$letter = $argv[++$i]
} else {
$opts.$letter = $true
}
} else {
return err "option -$letter not recognized"
return err "Option -$letter not recognized."
}
}
} else {
Expand Down
Loading

0 comments on commit 1c173bc

Please sign in to comment.