Commit Graph
187 Commits
Author SHA1 Message Date
x-kej 77a2769ace Catch unzip failures from bad file names (like ../file.exe) (#2472) 2018-08-08 20:36:28 +02:00
Mathias Hermansson cd33a9e31e Change sf regex not to break some manifests. Fixes #2474 (#2476) 2018-08-08 20:34:54 +02:00
Richard Kuhnt bf54a978a1 Add option to indent debug output 2018-08-08 11:48:58 +02:00
Richard Kuhnt 55ce0c0b0c Check if 7zip installed via Scoop instead of using 7z.exe from PATH 2018-08-08 11:06:35 +02:00
Richard Kuhnt 0f4640168d Refactor aria2_path() to file_path() 2018-08-08 11:06:20 +02:00
Richard Kuhnt ff1d7972ed Add aria2_enabled function 2018-08-07 20:11:38 +02:00
Richard Kuhnt f901911132 Fix global aria2 detection 2018-08-07 20:11:38 +02:00
Richard Kuhnt ba94d2bc2e Reshape Sourceforge.net URLs to avoid redirections 2018-08-07 20:11:38 +02:00
Richard Kuhnt b463b15b8d Add aria2 helper functions 2018-08-07 20:11:38 +02:00
Richard Kuhnt e8af15cc06 Store last update time as String (fixes #2239)
Prevents problems with PowerShell 5 and 6 using different methods to store dates in JSON
2018-08-07 19:56:43 +02:00
Ardelean Călin Petru f8c0ca7e9a Removed the bucket from the app name when checking directories. (#2435)
* Removed the bucket from the app name when checking directories.

* Smarter solution suggested by the review.
2018-07-29 21:45:53 +02:00
Richard Kuhnt 5d56f8ff57 format_hash(): format hashes to lowercase 2018-07-29 21:36:56 +02:00
Richard Kuhnt 0b13f37bc1 fix a bug introduced with e2792f2e
"break" prevented the extraction of multiple archive files
2018-07-10 21:31:46 +02:00
Richard Kuhnt 360c789965 Fix robocopy parameters (introduced with e2792f2e solving #2305) 2018-07-09 21:03:31 +02:00
Richard Kuhnt e2792f2e02 Fix robocopy not releasing a directory after moving it (closes #2305)
- Use System.Diagnostics.Process for better control
- Wait up to 1 second after moving a directory, so robocopy can terminate its threads
2018-07-09 12:34:00 +02:00
shorez d478a26ad0 Add basic WSL support by appending .exe to powershell (#2323) 2018-06-21 14:00:14 -07:00
Richard Kuhnt f8f9b75f05 Option to skip hash validation and error message improvements (#2260)
* Add show_app() function for displaying `app/bucket@version`

* Add option to skip hash check on install/update

Allows users to install an app when the manifest provides an outdated hash

* Show filename instead of robocopy output when moving fails

* Add new_issue_msg() for nicer error messages (with link bucket repo)

- returns a message with a link to the buckets GitHub repository
- clicking on the link opens a new issues with a predefined title

* Use new_issue_msg() for errors while moving files

- this removes the unreadable robocopy error dumps

* Use new_issue_msg() error handling for check_hash()

* Show robocopy exit code
2018-06-14 18:30:05 +02:00
Richard Kuhnt ff9c0c3daf parse_app(): fix for relative paths 2018-05-07 14:18:40 +02:00
Richard Kuhnt 70f64c8f4b Refactor app() to parse_app() for better "bucket/app@version" handling (#2234)
It now parses these app names:
- php-bucket/php71-amqp@1.8.0
- php-bucket/php71-amqp
- php71-amqp@1.8.0
- php71-amqp@1.9.0-rc2

Removed:
- is_app_with_specific_version()
- get_app_with_version()
2018-05-04 21:51:43 +02:00
Ross Smith II 0e2c253f38 Warn on shim overwrite (#2033) 2018-05-04 20:02:16 +02:00
Vladimir Chebotarev 3e14f37b3f Enabled shimming of external applications (#2072)
* Enabled shimming of external applications

* Improved correctness of target binding at shimming point.

* Fixed '| % { return ... }' issue.
2018-05-04 19:17:23 +02:00
Vladimir Chebotarev 6236750011 Fixed ps1/jar->ps1 shims args handling. (#2120) 2018-05-04 19:16:45 +02:00
Vladimir Chebotarev 563a1730a4 Temporary fixed passing arguments to ps1 shims. (#2118) 2018-05-04 19:16:35 +02:00
Steve Baker 9eca252913 wraptext: use buffer width instead of window width (fixes #2190) (#2191)
There exist two size properties in `$host.ui.rawui`, `windowsize` and
`buffersize`. PowerShell ISE doesn't support windowsize, causing
`wraptext` to incorrectly wrap in ISE. (#2190).

In the modern Windows 10 console (and eg the terminal in vscode), the
widths of buffersize and windowsize are always the same.

This change only affects users using pre-Windows 10 conhost, or the
Windows 10 conhost in legacy mode; and furthermore only if they have the
console window sized narrower than the buffer size (giving a horizontal
scroll bar). In this situation, all text in the console is suboptimally
displayed anyway.
2018-04-12 20:29:27 +02:00
Richard Kuhnt f3f559c460 Improve is_scoop_outdated() and add last_scoop_update() 2018-03-21 17:09:11 +01:00
Richard Kuhnt 12962acfa8 Use consistent User-Agent Header on all webrequests 2018-03-18 16:35:01 +01:00
Chawye Hsu 731247876d [Pending] Finally we add the code linting and its tests! (#2108)
* Lint: PSPossibleIncorrectComparisonWithNull

* Lint: PSUseLiteralInitializerForHashtable

* Lint: PSUseBOMForUnicodeEncodedFile

* Lint: PSUseApprovedVerbs

* Lint: PSAvoidGlobalVars

* Lint: PSAvoidUsingEmptyCatchBlock

* Lint: PSUseShouldProcessForStateChangingFunctions

* Lint helper: Add PSScriptAnalyzer integration for vscode

* Fix lint: PSUseBOMForUnicodeEncodedFile

* Tests: ignore previous TestResults.xml

* Tests: add PowerShell script linting into tests!

* Add PSScriptAnalyzer into appveyor ci

* Update Scoop-Linting.Tests.ps1
2018-03-13 14:26:55 +01:00
Pierre CHARLES 071af50671 Added retry when unzip fail because of AV (#1822) 2018-03-12 21:23:21 +01:00
Milan Gardian 63b325c4cb Fix "enable-encryptionscheme" for OSes before Windows 10 (#2084)
* Fix "enable-encryptionscheme" for OSes before Windows 10

- Tested on Windows 8.1 and Windows 10
- Also fixes indentation + clarifying comment

* Declare type of "enable-encryptionscheme" parameter instead of casting
2018-03-04 14:07:07 +01:00
Chawye Hsu e1bb1e91d0 Lint: PSAvoidUsingCmdletAliases (#2075) 2018-03-03 18:41:19 +01:00
Asad Saeeduddin 039f28b109 Enable TLS 1.2 in core.ps1 (#2074)
Enable TLS 1.2 in core.ps1
2018-03-02 06:04:25 +01:00
Vladimir Chebotarev 128262191b core.substitute() for arrays (#2048) 2018-02-26 14:09:11 +01:00
Richard Kuhnt f0a15886f2 Update validator.exe and shim.exe (#2024)
* Update Newtonsoft.Json and improve validator build process

* Improve shimexe build process and create deterministic builds
2018-02-20 18:48:02 +01:00
Richard Fussenegger b885ecf5ad Create sh shim (#1951)
* Create sh shim
* Fixed syntax error
* Shim CMD and PS only
* Added $arg to shims
* Added Script Switch to CMD
* Added JAR support and secured uninstall
2018-02-19 20:37:44 +01:00
Ross Smith II af41fc6efb Update virustotal command (#1918)
- Add * option to check all installed apps
- Add 60+ sec. pause after 4 queries/min to avoid 429/Too Many Requests
- Add immediate abort if query limit is exceeded
- Add INFO/WARN/ERROR prefixes to messages
- Add DarkGray/DarkCyan/DarkRed colors to INFO/WARN/ERROR messages
- Add using apikey if stored via: scoop config virustotal_api_key apikey
- Change colors to DarkGreen/DarkYellow/Yellow/Red for 0/1/2/3+ hit count
- Remove fragment from URL when submitting to virustotal.com
- Standardized INFO/WARN/ERROR messages
- virustotal: clean up per r15ch13's feedback
2017-12-28 17:24:02 +01:00
Richard Kuhnt 36dc7a880c Allow more architecture naming conventions for --arch parameters
closes #1908
2017-12-15 17:05:12 +01:00
Richard Kuhnt ef230c8b7b fix null reference error in strip_path() 2017-12-11 23:29:49 +01:00
Winter Young c86c727084 Fix scoop status error by improving scoop update (#1699)
* fix git status error
* Fix setting the lastupdate in is_scoop_outdated()
2017-09-10 19:46:19 +02:00
Richard Kuhnt d5c0654cc4 Improve ensure_all_installed() behavior 2017-08-30 22:12:32 +02:00
Richard Kuhnt 10bcc1f194 Add app_status() function to core
This function gathers all status information about an app and returns them as a hashtable
2017-08-30 22:10:44 +02:00
Richard Kuhnt 4ab82f60bb Run scoop update every so often before installing/updating apps
This change should reduce issues with outdated manifests/hashes/URLs.
Every successful execution of `scoop update` will save the date/time to `~\.scoop`
Every execution of `scoop update x` or `scoop install x` will check last saved date/time and run `scoop update` beforehand if the last run was more than 3 hours ago.
2017-08-30 17:17:38 +02:00
Richard Kuhnt 150cba623d Fix an error when reset_aliases() is called twice
Checks if the given scriptblock already exists
2017-08-30 17:07:27 +02:00
Richard Kuhnt 84bd16b82d Improve ensure_all_installed() behavior and move it to core.ps1
This change removes the use of abort() and exit 1 from ensure_all_installed() so the command doesn't stop if only one app in the list is not found.
2017-08-30 15:10:45 +02:00
Richard Kuhnt 9b3e7c83f9 Move applist() from update/cleanup commad to core 2017-08-30 15:06:54 +02:00
Nicolas Arnaud-Cormos 949cbabac0 Make scoop home agnostic
Rather use (Get-PsProvider 'FileSystem').home, in case the user
~ is not pointing to $home.
This can happen if the user wants to keep $home on $Env:USERPROFILE
but is working in a different folder and want it to be ~ (for simplicity).
2017-07-13 20:59:26 +02:00
Richard Kuhnt a92b76905e Running sccop from cmd without args should show help (closes #1530) 2017-06-02 17:46:27 +02:00
Richard Kuhnt e67d176d95 Change environment variables to uppercase 2017-05-31 00:27:21 +02:00
Richard Kuhnt f737315e73 Merge pull request #1517 from lukesampson/unix-compatible
[WIP] Add Unix compatibility (for maintenance jobs and manifest testing)
2017-05-30 21:59:15 +02:00
Richard Kuhnt 392bdf1a07 Move helper functions to unix.ps1 and updated comment 2017-05-28 14:08:27 +02:00
Richard Kuhnt 24fd3a3c7e Move unix compatible functions to unix.ps1
- Change helper functions to snake_case
2017-05-28 13:59:42 +02:00