summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-04-28 19:39:18 +0200
committerGitHub <noreply@github.com>2023-04-28 13:39:18 -0400
commit572af214a7256fde76d0fa69fc5791b1758455ef (patch)
tree29a01b010d44c01112acaea3d36581b1152ce90d
parentad03c6e0a36033c6f59262d8cfd6416ae3cc93d6 (diff)
downloadgitea-572af214a7256fde76d0fa69fc5791b1758455ef.tar.gz
gitea-572af214a7256fde76d0fa69fc5791b1758455ef.zip
Ensure final newline in `assets/go-licenses.json` (#24407)
This will ensure that the file always has a final newline. I'm not sure where this bug with inconsistent final newline actually comes from, it is likely Windows-related. --------- Co-authored-by: delvh <dev.lh@web.de>
-rw-r--r--assets/go-licenses.json2
-rw-r--r--build/generate-go-licenses.go5
2 files changed, 6 insertions, 1 deletions
diff --git a/assets/go-licenses.json b/assets/go-licenses.json
index 1b6ead5df6..090f595e74 100644
--- a/assets/go-licenses.json
+++ b/assets/go-licenses.json
@@ -1104,4 +1104,4 @@
"path": "xorm.io/xorm/LICENSE",
"licenseText": "Copyright (c) 2013 - 2015 The Xorm Authors\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n* Neither the name of the {organization} nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
}
-] \ No newline at end of file
+]
diff --git a/build/generate-go-licenses.go b/build/generate-go-licenses.go
index bdac51e71c..addab0762a 100644
--- a/build/generate-go-licenses.go
+++ b/build/generate-go-licenses.go
@@ -82,6 +82,11 @@ func main() {
panic(err)
}
+ // Ensure file has a final newline
+ if jsonBytes[len(jsonBytes)-1] != '\n' {
+ jsonBytes = append(jsonBytes, '\n')
+ }
+
err = os.WriteFile(out, jsonBytes, 0o644)
if err != nil {
panic(err)