Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import-Module failed at $glyphs["nf-fa-check"] #16

Closed
yuxuan-z19 opened this issue Jul 1, 2022 · 0 comments
Closed

Import-Module failed at $glyphs["nf-fa-check"] #16

yuxuan-z19 opened this issue Jul 1, 2022 · 0 comments

Comments

@yuxuan-z19
Copy link

yuxuan-z19 commented Jul 1, 2022

The script fails at line 119 char 30, which is $gitGlyph = $glyphs["nf-fa-check"]
I DID install Terminal-Icons and it WORKS pretty fine

Import-Module : 所在位置 C:\Program Files\WindowsPowerShell\Modules\PowerColorLS\1.0.4\Private\GitFunctions.ps1:119 字
符: 30
+         $gitGlyph = $glyphs["nf-fa-check"]
+                              ~~~~~~~~~~~~~
表达式或语句中包含意外的标记“nf-fa-check"]
    }
    $gitColor = (ConvertFrom-RGBColor -RGB ("00FF00"))
    foreach($gitStatusItem in $gitInfo.gitStatusItems){
        $updateGitStatus = $false
        $currentItemForGitCompare = $fileSystemInfo.FullName -Replace "\\", "/"
        if($currentItemForGitCompare -eq $gitStatusItem.path){
            $updateGitStatus = $true
        }elseif($isFolder -and ($gitStatusItem.path.StartsWith($currentItemForGitCompare,'CurrentCultureIgnoreCase'))){
            $updateGitStatus = $true
        }
        if($updateGitStatus){
            switch($gitStatusItem.status){
                "??" {
                    if($hideIcons){
                        $gitGlyph = "?";
                    }else{
                        $gitGlyph = $glyphs["nf-fa-question"]
                    }
                    $gitColor = (ConvertFrom-RGBColor -RGB ("FF0000"))
                }
                default{
                    $gitGlyph = $gitStatusItem.status
                    $gitColor = (ConvertFrom-RGBColor -RGB ("FFFF00"))
                }
            }
        }
    }
    $gitColorAndIcon = "${gitColor}${gitGlyph}”。
所在位置 C:\Program Files\WindowsPowerShell\Modules\PowerColorLS\1.0.4\Private\GitFunctions.ps1:149 字符: 48
+     $gitColorAndIcon = "${gitColor}${gitGlyph} "
+                                                ~
字符串缺少终止符: "
所在位置 C:\Program Files\WindowsPowerShell\Modules\PowerColorLS\1.0.4\Private\GitFunctions.ps1:116 字符: 19
+     if($hideIcons){
+                   ~
语句块或类型定义中缺少右“}”。
所在位置 C:\Program Files\WindowsPowerShell\Modules\PowerColorLS\1.0.4\Private\GitFunctions.ps1:97 字符: 29
+ function Get-GitColorAndIcon{
+                             ~
语句块或类型定义中缺少右“}”。
所在位置 行:1 字符: 1
+ Import-Module PowerColorLS
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ParserError: (:) [Import-Module], ParseException
    + FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.ImportModuleCommand

Updated As mentioned in Pull Request #15 , change encoding of GitFunctions.ps1 from UTF-8 to GBK/GB2312 (system's default encoding)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant