Browse Source

修复调试问题

gitlink
Sydonian 2 years ago
parent
commit
954c54fcbf
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      Makefile
  2. +2
    -1
      internal/cmdline/distlock.go

+ 1
- 1
Makefile View File

@@ -6,7 +6,7 @@ ASSETS_DIR_NAME = "assets"
BUILD_DIR = "../../build" BUILD_DIR = "../../build"


build: build:
go build -o ${BUILD_DIR}/${OUTPUT_DIR_NAME}/${OUTPUT_BINARY_NAME}
go build -o ${BUILD_DIR}/${OUTPUT_DIR_NAME}/${OUTPUT_BINARY_NAME}${OUTPUT_BINARY_EXT}
@if [ -d ${ASSETS_DIR_NAME} ] && [ -n "`ls -A ${ASSETS_DIR_NAME}`" ] ;then \ @if [ -d ${ASSETS_DIR_NAME} ] && [ -n "`ls -A ${ASSETS_DIR_NAME}`" ] ;then \
cp -r ${ASSETS_DIR_NAME}/* ${BUILD_DIR}/${OUTPUT_DIR_NAME}/; \ cp -r ${ASSETS_DIR_NAME}/* ${BUILD_DIR}/${OUTPUT_DIR_NAME}/; \
fi fi


+ 2
- 1
internal/cmdline/distlock.go View File

@@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"strings" "strings"


"github.com/samber/lo"
"gitlink.org.cn/cloudream/common/pkg/distlock" "gitlink.org.cn/cloudream/common/pkg/distlock"
"gitlink.org.cn/cloudream/common/pkg/distlock/lockprovider" "gitlink.org.cn/cloudream/common/pkg/distlock/lockprovider"
) )
@@ -49,7 +50,7 @@ func parseOneLock(lockData string) (distlock.Lock, error) {
target := lockprovider.NewStringLockTarget() target := lockprovider.NewStringLockTarget()
comps := strings.Split(fullPathAndTarget[1], "/") comps := strings.Split(fullPathAndTarget[1], "/")
for _, comp := range comps { for _, comp := range comps {
target.Add(strings.Split(comp, "."))
target.Add(lo.Map(strings.Split(comp, "."), func(str string, index int) any { return str })...)
} }


lock.Target = *target lock.Target = *target


Loading…
Cancel
Save