Redoing public export
This commit is contained in:
parent
4dec6e6735
commit
1c671bef6c
2 changed files with 49 additions and 1 deletions
|
@ -1,7 +1,10 @@
|
|||
FROM golang:1.20
|
||||
|
||||
# enable backports for git-filter-repo
|
||||
RUN echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list.d/backports.list
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
rsync libssl-dev postgresql sudo redis-server \
|
||||
rsync libssl-dev postgresql sudo redis-server git-filter-repo/bullseye-backports \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.1
|
||||
|
|
45
tools/testtool/commands/list_private_files.go
Normal file
45
tools/testtool/commands/list_private_files.go
Normal file
|
@ -0,0 +1,45 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var listPrivateFilesCmd = &cobra.Command{
|
||||
Use: "list-private-files",
|
||||
Short: "list private files",
|
||||
Run: runListPrivateFiles,
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(listPrivateFilesCmd)
|
||||
}
|
||||
|
||||
func doListPrivateFiles() error {
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
privateFiles := listPrivateFiles(".")
|
||||
for _, f := range privateFiles {
|
||||
rel, err := filepath.Rel(cwd, f)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println(rel)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func runListPrivateFiles(cmd *cobra.Command, args []string) {
|
||||
if err := doListPrivateFiles(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "testtool: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue