From 0ef4806272ee3d96e7f69cdcbec72c06b1952b76 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Thu, 2 Jul 2015 16:26:52 -0500 Subject: [PATCH 1/2] FIX gow.bat file generation * change method of generating gow.bat to generate a normal ASCII character file .# DISCUSSION At the PowerShell command line, using `echo STRING > FILE` will generate a UTF-8-BOM or UTF-16-BOM encoded file. But, CMD interprets files as using the 128-character ASCII character set (character codes 0 to 127). CMD will tolerate files using the full 256 character "extended-ASCII" set (or even larger dual-byte character sets). But, in this circumstance, interpretation/display is dependent on the currently selected code page. It's best to stick to pure ASCII files if at all possible. Using `STRING | Set-Content FILE` instead creates the correct ASCII character file. NOTE: ASCII (not "extended-ASCII") and UTF-8 (non-BOM) encoded files are exactly equivalent. ref: [Unicode UTF and BOM] http://www.unicode.org/faq/utf_bom.html @@ https://archive.is/TKnyk ref: [Unicode and NET] http://csharpindepth.com/Articles/General/Unicode.aspx @@ https://archive.is/czs89 --- gow.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gow.json b/gow.json index 2bea3125c7..9cf5498212 100644 --- a/gow.json +++ b/gow.json @@ -8,8 +8,10 @@ "url": "https://github.com/bmatzelle/gow/releases", "re": "Gow ([0-9\\.]+)" }, - "pre_install": "echo \"@cscript //NoLogo \"\"$dir\\bin\\gow.vbs\"\" %1\" > \"$dir\\bin\\gow.bat\" ", - "bin": [ + "pre_install": " + \"@cscript //NoLogo \"\"$dir\\bin\\gow.vbs\"\" %1\" | Set-Content -force \"$dir\\bin\\gow.bat\" + ", + "bin": [ "bin\\awk.exe", "bin\\basename.exe", "bin\\bash.exe", From 57b93a013ce7ebba635608746b65c04ff23ec948 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Thu, 2 Jul 2015 16:44:56 -0500 Subject: [PATCH 2/2] FIX `bash` startup failure (within GOW) * create the `etc` directory (if needed) .# DISCUSSION `bash` requires the `etc` directory for startup. However, `etc` is missing from the GOW repo. There are current pull requests fixing this issue (see bmatzelle/gow#192). But, this fixes the the issue while waiting for the GOW repo to be updated. The fix here is compatible with all of the current possible future GOW repo fixes. --- gow.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gow.json b/gow.json index 9cf5498212..fe6d1080fe 100644 --- a/gow.json +++ b/gow.json @@ -11,7 +11,11 @@ "pre_install": " \"@cscript //NoLogo \"\"$dir\\bin\\gow.vbs\"\" %1\" | Set-Content -force \"$dir\\bin\\gow.bat\" ", - "bin": [ + "post_install": " + # create etc directory (required by bash), if needed + if (! (test-path \"$dir\\etc\")) { new-item -itemtype directory \"$dir\\etc\" } + ", + "bin": [ "bin\\awk.exe", "bin\\basename.exe", "bin\\bash.exe",