Browse Source

init project

master
VIVIMAN 2 years ago
commit
c79b5fd91d
  1. 2
      .gitignore
  2. 38
      .goreleaser.yaml
  3. 8
      .idea/.gitignore
  4. 9
      .idea/awesomeProject.iml
  5. 11
      .idea/misc.xml
  6. 8
      .idea/modules.xml
  7. 52
      main.go

2
.gitignore

@ -0,0 +1,2 @@
dist/

38
.goreleaser.yaml

@ -0,0 +1,38 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# you may remove this if you don't use vgo
# - go mod tidy
# you may remove this if you don't need go generate
# - go generate ./...
builds:
- env:
- CGO_ENABLED=0
id: "awesomeProject"
binary: "awesomeProject"
goos:
- darwin
- linux
- windows
goarch:
- 386
- amd64
- arm
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "v1.0.0-snapshot"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

8
.idea/.gitignore

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 数据源本地存储已忽略文件
/../../../../../:\EPWork\goland\awesomeProject\.idea/dataSources/
/dataSources.local.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

9
.idea/awesomeProject.iml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

11
.idea/misc.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GOROOT" url="file://D:/Program Files/Go16" />
<component name="GoLibraries">
<option name="urls">
<list>
<option value="file://D:/go" />
</list>
</option>
</component>
</project>

8
.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/awesomeProject.iml" filepath="$PROJECT_DIR$/.idea/awesomeProject.iml" />
</modules>
</component>
</project>

52
main.go

@ -0,0 +1,52 @@
package main
import (
"fmt"
"os/exec"
"path/filepath"
)
func main() {
a, _ := filepath.Abs("./")
fmt.Printf("当前目录:%s\n", a)
del := "rm -rf ./unzip"
fmt.Printf("执行命令:%s\n", del)
cmd := exec.Command(del)
_ = cmd.Run()
// 执行解压操作,固定死目录和文件名称
// drc:drc jth:jth 同目录下存在 unzip 目录(用于解压文件)
shellUnzip := fmt.Sprintf("cd %s && "+
"export Hy7zEncryptPath=%s/drc.drc && "+
"export Hy7zJarPath=%s/jth.jth && "+
"export Hy7zLogFileName=%s/hy_7z.log && "+
"/opt/apps/cn.com.epsoft.qggwy/files/qggwy/jdk/bin/java -jar -Xms512m -XX:MetaspaceSize=256M -XX:MaxMetaspaceSize=512M "+
"%s/jth.jth unzip %s/1.hzb %s/unzip %s/unzip/Photos Z93z4H5b6z7d35b8", a, a, a, a, a, a, a, a)
fmt.Printf("执行命令:%s\n", shellUnzip)
cmd = exec.Command(shellUnzip)
_ = cmd.Run()
mvPhotos, all := fmt.Sprintf("cd %s/unzip/Photos", a), ""
fmt.Printf("执行命令:%s\n", mvPhotos)
cmd = exec.Command(mvPhotos)
_ = cmd.Run()
for _, i := range f {
for _, i2 := range f {
all += fmt.Sprintf("cd %s/%s/ && mv * ../ && ", i, i2)
}
all += fmt.Sprintf("cd %s/ && mv * ../ && ", i)
}
all += "ls"
fmt.Printf("执行命令:%s\n", all)
cmd = exec.Command(all)
_ = cmd.Run()
// 生成压缩包
zipFile := fmt.Sprintf("7z a 1.zip %s/unzip/", a)
fmt.Printf("执行命令:%s\n", zipFile)
cmd = exec.Command(zipFile)
_ = cmd.Run()
}
var f = []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}
Loading…
Cancel
Save