mirror of
https://github.com/ScoopInstaller/Main.git
synced 2025-11-07 09:11:18 +00:00
Implement testing using Pester
Integrate with AppVeyor
This commit is contained in:
parent
ca3a0ae014
commit
3741af6fa3
@ -7,19 +7,26 @@
|
|||||||
"extract_dir": "pester-3.3.6",
|
"extract_dir": "pester-3.3.6",
|
||||||
"bin": "bin\\pester.bat",
|
"bin": "bin\\pester.bat",
|
||||||
"post_install": "
|
"post_install": "
|
||||||
|
$import = \"try { `$null = gcm pester -ea stop; import-module `\"$dir\\pester.psm1`\" } catch { }\"
|
||||||
|
|
||||||
|
if($profile) {
|
||||||
|
'adding pester to powershell profile...'
|
||||||
if(!(test-path $profile)) {
|
if(!(test-path $profile)) {
|
||||||
|
'powershell profile doesn''t exist. creating...'
|
||||||
$profile_dir = split-path $profile
|
$profile_dir = split-path $profile
|
||||||
if(!(test-path $profile_dir)) { mkdir $profile_dir > $null }
|
if(!(test-path $profile_dir)) { mkdir $profile_dir > $null }
|
||||||
'' > $profile
|
'' > $profile
|
||||||
}
|
}
|
||||||
|
|
||||||
$import = \"try { `$null = gcm pester -ea stop; import-module `\"$dir\\pester.psm1`\" } catch { }\"
|
|
||||||
$text = get-content $profile
|
$text = get-content $profile
|
||||||
if (($text | sls 'pester') -eq $null) {
|
if (($text | sls 'pester') -eq $null) {
|
||||||
$new_profile = @($text) + $import
|
$new_profile = @($text) + $import
|
||||||
$new_profile > $profile
|
$new_profile > $profile
|
||||||
|
success 'pester added to powershell profile.'
|
||||||
}
|
}
|
||||||
|
} else { warn 'no powershell profile found. the pester module will not be imported each session.' }
|
||||||
|
|
||||||
|
'importing pester for current session...'
|
||||||
iex \"$import\"
|
iex \"$import\"
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user