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

fix(cli): fix console printing #2483

Merged
merged 1 commit into from
Apr 1, 2023
Merged

fix(cli): fix console printing #2483

merged 1 commit into from
Apr 1, 2023

Conversation

misitebao
Copy link
Contributor

Fix console printing.

Old:

$ wails generate template -name VT -frontend ./vue-project/
DEB | Using go webview2loader

# Generating template

  • Extracting base template files...  • Migrating existing project files to frontend directory...  • Updating package.json data...  • Renaming package.json -> package.tmpl.json...  • Updating package-lock.json data...  • Renaming package-lock.json -> package-lock.tmpl.json... ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

New:

$ wails generate template -name VT -frontend ./vue-project/
DEB | Using go webview2loader

# Generating template

  • Extracting base template files...
  • Migrating existing project files to frontend directory...
  • Updating package.json data...
  • Renaming package.json -> package.tmpl.json...
  • Updating package-lock.json data...
  • Renaming package-lock.json -> package-lock.tmpl.json...
 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

@vercel
Copy link

vercel bot commented Mar 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
wails-v3-docs ❌ Failed (Inspect) Mar 31, 2023 at 10:18PM (UTC)

@misitebao misitebao changed the title fix: fix console printing fix(cli): fix console printing Mar 12, 2023
@misitebao misitebao requested a review from stffabi March 12, 2023 00:49
v2/cmd/wails/main.go Outdated Show resolved Hide resolved
@leaanthony
Copy link
Member

Just a thought. I think the reason I added the trim to start with was to handle multi-line output. What if we left the original trim, but used Println rather than Print?

@misitebao
Copy link
Contributor Author

@leaanthony Is there any problem with this PR?

@leaanthony
Copy link
Member

Not a problem, I just need to look at it. I'm sure the original code was intended to join output lines and use println to output it. I don't think the solution is to change the strip line but to add println rather than printf

@misitebao
Copy link
Contributor Author

misitebao commented Mar 31, 2023

Hi, @leaanthony

MisiteBao@MISITEBAO-PC MINGW64 ~/Desktop
$ wails generate template -name wtv -frontend ./vite-project/
DEB | Using go webview2loader

# Generating template

  • Extracting base template files...
  • Migrating existing project files to frontend directory...
  • Updating package.json data...
  • Renaming package.json -> package.tmpl.json...

  ERROR   no package-lock.json found - cannot process
 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

MisiteBao@MISITEBAO-PC MINGW64 ~/Desktop
$ wails build -v 2
DEB | Using go webview2loader
Wails CLI v2.4.1


# Build Options

Platform(s)        | windows/amd64
Compiler           | C:\Program Files\Go\bin\go.exe
Skip Bindings      | false
Build Mode         | production
Frontend Directory | C:\Users\MisiteBao\Desktop\ws\frontend
Obfuscated         | false
Skip Frontend      | false
Compress           | false
Package            | true
Clean Bin Dir      | false
LDFlags            |
Tags               | []
Race Detector      | false

# Building target: windows/amd64

  • Generating bindings:
 INFO
Done.
  • Installing frontend dependencies:

 INFO  Install command: 'npm install'
Skipping npm install
Done.
  • Compiling frontend:

 INFO  Build command: 'npm run build'

    > frontend@0.0.0 build
    > vite build

    vite v3.2.5 building for production...
    transforming...
    ✓ 16 modules transformed.
    rendering chunks...
    dist/assets/logo-universal.d5b974be.png               136.42 KiB
    dist/assets/nunito-v16-latin-regular.06f3af3f.woff2   18.53 KiB
    dist/index.html                                       0.35 KiB
    dist/assets/index.85345b5c.css                        1.23 KiB / gzip: 0.59 KiB
    dist/assets/index.dc486b5a.js                         53.32 KiB / gzip: 21.59 KiB


Done.
  • Generating application assets:
Done.
  • Compiling application:

 INFO  Build command: go build -tags desktop,wv2runtime.download,production -ldflags "-w -s -H windowsgui" -o C:\Users\MisiteBao\Desktop\ws\build\bin\ws.exe
  • Environment:%!(EXTRA string=ACLOCAL_PATH=C:\Program Files\Git\mingw64\share\aclocal;C:\Program Files\Git\usr\share\aclocal ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\MisiteBao\AppData\Roaming COMMONPROGRAMFILES=C:\Program Files\Common Files COMPUTERNAME=MISITEBAO-PC COMSPEC=C:\WINDOWS\system32\cmd.exe CONFIG_SITE=C:/Program Files/Git/etc/config.site CROWDIN_PERSONAL_TOKEN=f41552d3378890ea81da33a626c68c62606abd4afd2fc0720b456c4f5bf5aa792dc3861e508f2fb7 ChocolateyInstall=C:\ProgramData\chocolatey ChocolateyLastPathUpdate=133234679584271775 CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files DISPLAY=needs-to-be-defined DriverData=C:\Windows\System32\Drivers\DriverData EXEPATH=C:\Program Files\Git\bin FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer FPS_BROWSER_USER_PROFILE_STRING=Default GOBIN=C:\Users\MisiteBao\go\bin GOPATH=C:\Users\MisiteBao\go GOPROXY=https://goproxy.cn,direct HOME=C:\Users\MisiteBao HOMEDRIVE=C: HOMEPATH=\Users\MisiteBao HOSTNAME=MISITEBAO-PC INFOPATH=C:\Program Files\Git\mingw64\local\info;C:\Program Files\Git\mingw64\share\info;C:\Program Files\Git\usr\local\info;C:\Program Files\Git\usr\share\info;C:\Program Files\Git\usr\info;C:\Program Files\Git\share\info LANG=zh_CN.UTF-8 LOCALAPPDATA=C:\Users\MisiteBao\AppData\Local LOGONSERVER=\\MISITEBAO-PC MANPATH=C:\Program Files\Git\mingw64\local\man;C:\Program Files\Git\mingw64\share\man;C:\Program Files\Git\usr\local\man;C:\Program Files\Git\usr\share\man;C:\Program Files\Git\usr\man;C:\Program Files\Git\share\man MINGW_CHOST=x86_64-w64-mingw32 MINGW_PACKAGE_PREFIX=mingw-w64-x86_64 MINGW_PREFIX=C:/Program Files/Git/mingw64 MSYSTEM=MINGW64 MSYSTEM_CARCH=x86_64 MSYSTEM_CHOST=x86_64-w64-mingw32 MSYSTEM_PREFIX=C:/Program Files/Git/mingw64 NUMBER_OF_PROCESSORS=20 NVM_HOME=C:\Users\MisiteBao\AppData\Roaming\NVM NVM_SYMLINK=C:\Program Files\NodeJS OLDPWD=C:/Users/MisiteBao/Desktop ORIGINAL_PATH=C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\MisiteBao\bin;C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Go\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Users\MisiteBao\AppData\Roaming\NVM;C:\Program Files\NodeJS;C:\Program Files (x86)\Tencent\微信web开发者工具\dll;C:\Program Files\dotnet;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\MisiteBao\AppData\Local\pnpm;C:\Users\MisiteBao\AppData\Local\Programs\Python\Python312\Scripts;C:\Users\MisiteBao\AppData\Local\Programs\Python\Python312;C:\Users\MisiteBao\AppData\Local\Programs\Python\Launcher;C:\Users\MisiteBao\.cargo\bin;C:\Users\MisiteBao\AppData\Local\Microsoft\WindowsApps;C:\Users\MisiteBao\go\bin;C:\Users\MisiteBao\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\MisiteBao\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\MisiteBao\AppData\Roaming\Python\Python312\Scripts;C:\Users\MisiteBao\.dotnet\tools;C:\Users\MisiteBao\.deno\bin;C:\Users\MisiteBao\AppData\Local\Komac;C:\Program Files (x86)\Tencent\QQGameTempest\Hall.57938;C:\Users\MisiteBao\AppData\Local\Microsoft\WinGet\Links ORIGINAL_TEMP=C:/Users/MISITE~1/AppData/Local/Temp ORIGINAL_TMP=C:/Users/MISITE~1/AppData/Local/Temp OS=Windows_NT OneDrive=C:\Users\MisiteBao\OneDrive PATH=C:\Users\MisiteBao\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\MisiteBao\bin;C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Go\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Users\MisiteBao\AppData\Roaming\NVM;C:\Program Files\NodeJS;C:\Program Files (x86)\Tencent\微信web开发者 工具\dll;C:\Program Files\dotnet;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\MisiteBao\AppData\Local\pnpm;C:\Users\MisiteBao\AppData\Local\Programs\Python\Python312\Scripts;C:\Users\MisiteBao\AppData\Local\Programs\Python\Python312;C:\Users\MisiteBao\AppData\Local\Programs\Python\Launcher;C:\Users\MisiteBao\.cargo\bin;C:\Users\MisiteBao\AppData\Local\Microsoft\WindowsApps;C:\Users\MisiteBao\go\bin;C:\Users\MisiteBao\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\MisiteBao\AppData\Local\JetBrains\Toolbox\scripts;C:\Users\MisiteBao\AppData\Roaming\Python\Python312\Scripts;C:\Users\MisiteBao\.dotnet\tools;C:\Users\MisiteBao\.deno\bin;C:\Users\MisiteBao\AppData\Local\Komac;C:\Program Files (x86)\Tencent\QQGameTempest\Hall.57938;C:\Users\MisiteBao\AppData\Local\Microsoft\WinGet\Links;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PKG_CONFIG_PATH=C:\Program Files\Git\mingw64\lib\pkgconfig;C:\Program Files\Git\mingw64\share\pkgconfig PKG_CONFIG_SYSTEM_INCLUDE_PATH=C:/Program Files/Git/mingw64/include PKG_CONFIG_SYSTEM_LIBRARY_PATH=C:/Program Files/Git/mingw64/lib PLINK_PROTOCOL=ssh PNPM_HOME=C:\Users\MisiteBao\AppData\Local\pnpm PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 62 Stepping 4, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=3e04 PROGRAMFILES=C:\Program Files PS1=\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$  PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules PUBLIC=C:\Users\Public PWD=C:/Users/MisiteBao/Desktop/ws ProgramData=C:\ProgramData ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files SHELL=C:\Program Files\Git\usr\bin\bash.exe SHLVL=1 SSH_ASKPASS=C:/Program Files/Git/mingw64/bin/git-askpass.exe SYSTEMDRIVE=C: SYSTEMROOT=C:\WINDOWS TEMP=C:\Users\MISITE~1\AppData\Local\Temp TERM=xterm-256color TMP=C:\Users\MISITE~1\AppData\Local\Temp TMPDIR=C:\Users\MISITE~1\AppData\Local\Temp USERDOMAIN=MISITEBAO-PC USERDOMAIN_ROAMINGPROFILE=MISITEBAO-PC USERNAME=MisiteBao USERPROFILE=C:\Users\MisiteBao WINDIR=C:\WINDOWS WSLENV=WT_SESSION::WT_PROFILE_ID WT_PROFILE_ID={2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b} WT_SESSION=7801abe2-9713-435a-9d78-67e97b96defe _=C:/Users/MisiteBao/go/bin/wails GOOS=windows GOARCH=amd64)
Done.
 INFO  Wails is now using the new Go WebView2Loader. If you encounter any issues with it, please report them to https://github.com/wailsapp/wails/issues/2004. You could also use the old legacy loader with `-tags native_webview2loader`, but keep in mind this will be deprecated in the near future.
Built 'C:\Users\MisiteBao\Desktop\ws\build\bin\ws.exe' in 10.888s.

@leaanthony
Copy link
Member

Does this now work as expected?

@misitebao
Copy link
Contributor Author

Does this now work as expected?

On Windows platform, works as expected.

@leaanthony leaanthony merged commit eddc949 into wailsapp:master Apr 1, 2023
@misitebao misitebao deleted the bugfix/fix-console-printing branch April 1, 2023 09:06
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

Successfully merging this pull request may close these issues.

2 participants