Skip to content

Commit 2726490

Browse files
committed
final updates before the v0.2.0 release
1 parent 28f47e0 commit 2726490

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* Added special module import process when the `ModuleToImport` is `EditorServicesCommandSuite` so it also automatically registers the available editor commands.
2222
* [Issue #12](https://github.com/scrthq/PSProfile/issues/12)
2323
* Added `Start-PSProfileConfigurationHelper` to provide an easy way to get started with configuring your PSProfile.
24+
* [Issue #6](https://github.com/scrthq/PSProfile/issues/6)
25+
* Added `PSReadline` key to `$PSProfile.Settings` (Settings management in development still.)
2426
* Miscellaneous
2527
* Added support for multiple Command Aliases to be removed at once with `Remove-PSProfileCommandAlias`.
2628
* Updated default `SCRTHQ` prompt that comes with the module.
@@ -36,6 +38,7 @@
3638
* Updated CONTRIBUTING.md with snippet to include for PSProfile developers on their PowerShell profile.
3739
* Refactored `Get-PSProfilePrompt` to return `$null` if a name is specified but does not exist on the current PSProfile configuration.
3840
* Refactored `$PSProfile._loadConfiguration()` to start with the base value of `$Global:PSProfile` if present, otherwise import the existing configuration from file. This is necessary to retain the existing configuration if an action is taken that forces the PSProfile to reload, e.g. adding a new plugin to the configuration.
41+
* Updated `$PSProfile._loadPrompt()` method to set the value of `$function:prompt` directly instead of calling `Switch-PSProfilePrompt` to reduce overhead.
3942

4043
## 0.1.9 - 2019-08-26
4144

PSProfile/Classes/PSProfile.Classes.ps1

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ class PSProfile {
148148
Default = "AWS: "
149149
}
150150
}
151+
PSReadline = @{
152+
Options = @{}
153+
KeyHandlers = @{}
154+
}
151155
}
152156
$this.RefreshFrequency = (New-TimeSpan -Hours 1).ToString()
153157
$this.LastRefresh = [datetime]::Now.AddHours(-2)
@@ -283,7 +287,7 @@ if ($env:AWS_PROFILE) {
283287
"MAIN",
284288
"Verbose"
285289
)
286-
$this._cleanModules()
290+
$this._cleanConfig()
287291
$this._findProjects()
288292
$this._installModules()
289293
$this._createSymbolicLinks()
@@ -312,30 +316,47 @@ if ($env:AWS_PROFILE) {
312316
}
313317
return $content
314318
}
315-
hidden [void] _cleanModules() {
319+
hidden [void] _cleanConfig() {
316320
$this._log(
317321
"SECTION START",
318-
"CleanModules",
322+
"CleanConfig",
319323
"Debug"
320324
)
321325
foreach ($section in @('ModulesToImport','ModulesToInstall')) {
326+
$this._log(
327+
"[$section] Cleaning section",
328+
"CleanConfig",
329+
"Verbose"
330+
)
322331
[hashtable[]]$final = @()
323332
$this.$section | Where-Object {$_ -is [hashtable] -and $_.Name} | ForEach-Object {
324333
$final += $_
325334
}
326335
$this.$section | Where-Object {$_ -is [string]} | ForEach-Object {
327336
$this._log(
328337
"[$section] Converting module string to hashtable: $_",
329-
"CleanModules",
338+
"CleanConfig",
330339
"Verbose"
331340
)
332341
$final += @{Name = $_}
333342
}
334343
$this.$section = $final
335344
}
345+
foreach ($section in @('ScriptPaths','PluginPaths','ProjectPaths')) {
346+
$this._log(
347+
"[$section] Cleaning section",
348+
"CleanConfig",
349+
"Verbose"
350+
)
351+
[string[]]$final = @()
352+
$this.$section | Where-Object {-not [string]::IsNullOrEmpty($_)} | ForEach-Object {
353+
$final += $_
354+
}
355+
$this.$section = $final
356+
}
336357
$this._log(
337358
"SECTION END",
338-
"CleanModules",
359+
"CleanConfig",
339360
"Debug"
340361
)
341362
}

0 commit comments

Comments
 (0)