Skip to content

Commit

Permalink
chore: Merge pull request #961 from Xhofe/dev
Browse files Browse the repository at this point in the history
Dev v2.4.1
  • Loading branch information
xhofe authored Apr 17, 2022
2 parents 4e6a442 + d38f36e commit 82a5c43
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
12 changes: 0 additions & 12 deletions alist_test.go

This file was deleted.

16 changes: 3 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,8 @@ BUILD() {
gitTag=$(git describe --long --tags --dirty --always)
webTag=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist-web/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
echo "build version: $gitTag"

ldflags="\
-w -s --extldflags '-static -fpic' \
-X 'github.com/Xhofe/alist/conf.BuiltAt=$builtAt' \
-X 'github.com/Xhofe/alist/conf.GoVersion=$goVersion' \
-X 'github.com/Xhofe/alist/conf.GitAuthor=$gitAuthor' \
-X 'github.com/Xhofe/alist/conf.GitCommit=$gitCommit' \
-X 'github.com/Xhofe/alist/conf.GitTag=$gitTag' \
-X 'github.com/Xhofe/alist/conf.WebTag=$webTag' \
"
ldflagsDarwin="\
-w -s \
-X 'github.com/Xhofe/alist/conf.BuiltAt=$builtAt' \
-X 'github.com/Xhofe/alist/conf.GoVersion=$goVersion' \
Expand All @@ -70,11 +62,9 @@ BUILD() {
-X 'github.com/Xhofe/alist/conf.WebTag=$webTag' \
"
if [ "$1" == "release" ]; then
xgo -targets=linux/*,windows/* -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
xgo -targets=darwin/* -out "$appName" -ldflags="$ldflagsDarwin" -tags=jsoniter .
xgo -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
else
xgo -targets=linux/amd64,windows/amd64 -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
xgo -targets=darwin/amd64 -out "$appName" -ldflags="$ldflagsDarwin" -tags=jsoniter .
xgo -targets=linux/amd64,windows/amd64,darwin/amd64 -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
fi
mkdir -p "build"
mv alist-* build
Expand Down
2 changes: 1 addition & 1 deletion drivers/native/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func (driver Native) Files(path string, account *model.Account) ([]model.File, e
time := f.ModTime()
file := model.File{
Name: f.Name(),
Size: f.Size(),
Type: 0,
UpdatedAt: &time,
Driver: driver.Config().Name,
Expand All @@ -112,6 +111,7 @@ func (driver Native) Files(path string, account *model.Account) ([]model.File, e
file.Type = conf.FOLDER
} else {
file.Type = utils.GetFileType(filepath.Ext(f.Name()))
file.Size = f.Size()
}
files = append(files, file)
}
Expand Down

0 comments on commit 82a5c43

Please sign in to comment.