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 #6468 - Uses space match and adds newline for all sed flavors #6473

Merged
merged 3 commits into from
Apr 1, 2019

Conversation

richmahn
Copy link
Contributor

@richmahn richmahn commented Mar 30, 2019

Fix for: #6468

This makes it so both GNU sed (Linux) and FreeBSD sed (MacOS) can be used for the sed commands used after the swagger command in make generate-swagger.

  1. FreeBSD sed does not support \s so just a space is used now between basePath: and "/api/v1" as that all there will be.

  2. For the new line at end of file, FreeBSD feels it should always add it, GNU sed does not. Easiest to add the -e '$a\' command which adds a new line at the end of a file if one doesn't already exist.

Before one could use homebrew to install GNU sed and rename gsed to sed, but now one can't. Also aliasing gsed to sed was not possible.

@codecov-io
Copy link

codecov-io commented Mar 30, 2019

Codecov Report

Merging #6473 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6473      +/-   ##
==========================================
- Coverage    39.4%   39.39%   -0.01%     
==========================================
  Files         393      393              
  Lines       53271    53271              
==========================================
- Hits        20992    20988       -4     
- Misses      29292    29297       +5     
+ Partials     2987     2986       -1
Impacted Files Coverage Δ
models/unit.go 0% <0%> (-14.29%) ⬇️
routers/repo/view.go 41.08% <0%> (-1%) ⬇️
models/repo_list.go 67.89% <0%> (+1.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbba46c...a46e0e1. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 30, 2019
Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always feel it's a shame that bsd never takes obvious gnu improvements - or even proposes them to POSIX. It almost feels like a case of NIH.

Fine, I guess we need to do this.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 30, 2019
@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Mar 31, 2019
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 31, 2019
@zeripath zeripath changed the title Fies #6468 - Uses space match and adds newline for all sed flavors Fix #6468 - Uses space match and adds newline for all sed flavors Mar 31, 2019
@lunny lunny merged commit 4e3ce71 into go-gitea:master Apr 1, 2019
@lunny lunny added this to the 1.9.0 milestone Apr 1, 2019
richmahn added a commit to richmahn/gitea that referenced this pull request Apr 11, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants