Skip to content

Commit 98fd2a1

Browse files
authored
chore: cleanup makefile, remove unnecessary scripts (gogf#4684)
This pull request primarily removes submodule management targets from the `Makefile` and makes minor updates to the project documentation in both English and Chinese. The most important changes are grouped below. Makefile cleanup: * Removed the `subup` and `subsync` targets from the `Makefile`, eliminating commands related to updating and committing submodules. Documentation updates: * Updated the logo alt text in both `README.MD` and `README.zh_CN.MD` from "goframe gf logo" to "goframe logo" for clarity. [[1]](diffhunk://#diff-01e6d9ffed056a02cae8d8a0ec5d476a64d017bf85c0d5a94bb23ca21f33f5aaL4-R4) [[2]](diffhunk://#diff-c93759cb9a9500f20e551c741eb167fc72825fd638d36121357feb8253ce6ac1L4-R4) * Revised a description in `README.zh_CN.MD` to clarify the framework's purpose, changing “一个强大的框架” to “一款强大的框架”. * Simplified the license description in `README.zh_CN.MD` to state "100%开源和免费".
1 parent d5633eb commit 98fd2a1

5 files changed

Lines changed: 25 additions & 39 deletions

File tree

.make_tidy.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/env bash
22

3+
# Function to run sed in-place with OS-specific options
4+
sed_replace() {
5+
if [[ "$OSTYPE" == "darwin"* ]]; then
6+
# macOS - requires empty string after -i
7+
sed -i '' "$@"
8+
else
9+
# Linux/Windows Git Bash
10+
sed -i "$@"
11+
fi
12+
}
13+
314
workdir=.
415
echo "Prepare to tidy all go.mod files in the ${workdir} directory"
516

@@ -27,9 +38,9 @@ for file in `find ${workdir} -name go.mod`; do
2738

2839
cd $goModPath
2940
# Remove indirect dependencies
30-
sed -i '/\/\/ indirect/d' go.mod
41+
sed_replace '/\/\/ indirect/d' go.mod
3142
go mod tidy
3243
# Remove toolchain line if exists
33-
sed -i '' '/^toolchain/d' go.mod
44+
sed_replace '/^toolchain/d' go.mod
3445
cd - > /dev/null
3546
done

.make_version.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Function to run sed in-place with OS-specific options
4-
sed_inplace() {
4+
sed_replace() {
55
if [[ "$OSTYPE" == "darwin"* ]]; then
66
# macOS - requires empty string after -i
77
sed -i '' "$@"
@@ -40,11 +40,11 @@ fi
4040

4141
if [[ true ]]; then
4242
# Use sed to replace the version number in version.go
43-
sed_inplace 's/VERSION = ".*"/VERSION = "'${newVersion}'"/' version.go
43+
sed_replace 's/VERSION = ".*"/VERSION = "'${newVersion}'"/' version.go
4444

4545
# Use sed to replace the version number in README.MD
46-
sed_inplace 's/version=[^"]*/version='${newVersion}'/' README.MD
47-
sed_inplace 's/version=[^"]*/version='${newVersion}'/' README.zh_CN.MD
46+
sed_replace 's/version=[^"]*/version='${newVersion}'/' README.MD
47+
sed_replace 's/version=[^"]*/version='${newVersion}'/' README.zh_CN.MD
4848
fi
4949

5050
if [ -f "go.work" ]; then
@@ -81,20 +81,20 @@ for file in `find ${workdir} -name go.mod`; do
8181
go mod edit -replace github.com/gogf/gf/contrib/drivers/sqlite/v2=../../contrib/drivers/sqlite
8282
fi
8383
# Remove indirect dependencies
84-
sed_inplace '/\/\/ indirect/d' go.mod
84+
sed_replace '/\/\/ indirect/d' go.mod
8585
go mod tidy
8686
# Remove toolchain line if exists
87-
sed_inplace '/^toolchain/d' go.mod
87+
sed_replace '/^toolchain/d' go.mod
8888

8989
# Upgrading only GoFrame related libraries, sometimes even if a version number is specified,
9090
# it may not be possible to successfully upgrade. Please confirm before submitting the code
9191
go list -f "{{if and (not .Indirect) (not .Main)}}{{.Path}}@${newVersion}{{end}}" -m all | grep "^github.com/gogf/gf"
9292
go list -f "{{if and (not .Indirect) (not .Main)}}{{.Path}}@${newVersion}{{end}}" -m all | grep "^github.com/gogf/gf" | xargs -L1 go get -v
9393
# Remove indirect dependencies
94-
sed_inplace '/\/\/ indirect/d' go.mod
94+
sed_replace '/\/\/ indirect/d' go.mod
9595
go mod tidy
9696
# Remove toolchain line if exists
97-
sed_inplace '/^toolchain/d' go.mod
97+
sed_replace '/^toolchain/d' go.mod
9898
if [ $goModPath = "./cmd/gf" ]; then
9999
go mod edit -dropreplace github.com/gogf/gf/v2
100100
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/clickhouse/v2

Makefile

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,6 @@ tag:
5252
git push origin $$newVersion; \
5353
echo "Tag $$newVersion created and pushed successfully!"
5454

55-
# update submodules
56-
.PHONY: subup
57-
subup:
58-
@set -e; \
59-
echo "Updating submodules..."; \
60-
git submodule init;\
61-
git submodule update;
62-
63-
# update and commit submodules
64-
.PHONY: subsync
65-
subsync: subup
66-
@set -e; \
67-
echo "";\
68-
cd examples; \
69-
echo "Checking for changes..."; \
70-
if git diff-index --quiet HEAD --; then \
71-
echo "No changes to commit"; \
72-
else \
73-
echo "Found changes, committing..."; \
74-
git add -A; \
75-
git commit -m "examples update"; \
76-
git push origin; \
77-
fi; \
78-
cd ..;
79-
8055
# manage docker services for local development
8156
# usage: make docker or make docker cmd=start svc=mysql
8257
.PHONY: docker

README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
English | [简体中文](README.zh_CN.MD)
22

33
<div align=center>
4-
<img src="https://goframe.org/img/logo_full.png" width="300" alt="goframe gf logo"/>
4+
<img src="https://goframe.org/img/logo_full.png" width="300" alt="goframe logo"/>
55

66
[![Go Reference](https://pkg.go.dev/badge/github.com/gogf/gf/v2.svg)](https://pkg.go.dev/github.com/gogf/gf/v2)
77
[![GoFrame CI](https://github.com/gogf/gf/actions/workflows/ci-main.yml/badge.svg)](https://github.com/gogf/gf/actions/workflows/ci-main.yml)

README.zh_CN.MD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[English](README.MD) | 简体中文
22

33
<div align=center>
4-
<img src="https://goframe.org/img/logo_full.png" width="300" alt="goframe gf logo"/>
4+
<img src="https://goframe.org/img/logo_full.png" width="300" alt="goframe logo"/>
55

66
[![Go Reference](https://pkg.go.dev/badge/github.com/gogf/gf/v2.svg)](https://pkg.go.dev/github.com/gogf/gf/v2)
77
[![GoFrame CI](https://github.com/gogf/gf/actions/workflows/ci-main.yml/badge.svg)](https://github.com/gogf/gf/actions/workflows/ci-main.yml)
@@ -23,7 +23,7 @@
2323

2424
</div>
2525

26-
一个强大的框架,为了更快、更轻松、更高效的项目开发。
26+
一款强大的框架,为了更快、更轻松、更高效的项目开发。
2727

2828
## 安装
2929

@@ -51,4 +51,4 @@ go get -u github.com/gogf/gf/v2
5151

5252
## 许可证
5353

54-
`GoFrame` 采用 [MIT License](LICENSE) 许可,100% 免费和开源,永久保持
54+
`GoFrame` 采用 [MIT License](LICENSE) 许可,100%开源和免费

0 commit comments

Comments
 (0)