From 5d56646586474aac5bd10196e5bcd7eb77b98e59 Mon Sep 17 00:00:00 2001 From: olup Date: Sun, 31 Jul 2022 22:19:49 +0200 Subject: [PATCH] feat: sentry & update detector --- .github/workflows/build-next.yaml | 6 +- .github/workflows/build-version.yaml | 6 +- .gitignore | 1 + app.go | 112 ++++++++++++++++++++++-- frontend/src/App.tsx | 84 +++++++----------- frontend/src/components/AboutModal.tsx | 107 ++++++++++++++++++++++ frontend/src/components/DeviceModal.tsx | 64 -------------- frontend/src/components/Header.tsx | 47 ++++++---- frontend/src/components/UpdateModal.tsx | 55 ++++++++++++ frontend/src/hooks/useApi.ts | 16 +++- frontend/wailsjs/go/main/App.d.ts | 5 +- frontend/wailsjs/go/main/App.js | 4 + frontend/wailsjs/go/models.ts | 39 +++++++++ go.mod | 2 + go.sum | 8 +- scripts/get-version.sh | 2 + 16 files changed, 412 insertions(+), 146 deletions(-) create mode 100644 frontend/src/components/AboutModal.tsx delete mode 100644 frontend/src/components/DeviceModal.tsx create mode 100644 frontend/src/components/UpdateModal.tsx create mode 100755 scripts/get-version.sh diff --git a/.github/workflows/build-next.yaml b/.github/workflows/build-next.yaml index aa084fe..69f9f72 100644 --- a/.github/workflows/build-next.yaml +++ b/.github/workflows/build-next.yaml @@ -40,7 +40,7 @@ jobs: run: | Set-Item -Path Env:CGO_LDFLAGS -Value "-LD:/a/lunii-admin/lunii-admin/bindings/windows/lib" Set-Item -Path Env:CGO_CFLAGS -Value "-ID:/a/lunii-admin/lunii-admin/bindings/windows/include" - wails build -debug -o lunii-admin_windows_amd64.exe -ldflags "-v '-extldflags=-static -lm'" + go generate && wails build -debug -o lunii-admin_windows_amd64.exe -ldflags "-v '-extldflags=-static -lm'" - uses: ncipollo/release-action@v1 with: @@ -86,7 +86,7 @@ jobs: run: go install github.com/wailsapp/wails/v2/cmd/wails@latest - name: Build - run: wails build -debug -o lunii-admin_linux_amd64 + run: go generate && wails build -debug -o lunii-admin_linux_amd64 - uses: ncipollo/release-action@v1 with: @@ -131,7 +131,7 @@ jobs: run: go install github.com/wailsapp/wails/v2/cmd/wails@latest - name: Build - run: wails build -debug + run: go generate && wails build -debug - name: Create Zip run: ditto -c -k --sequesterRsrc --keepParent build/bin/lunii-admin.app lunii-admin_darwin_amd64.zip diff --git a/.github/workflows/build-version.yaml b/.github/workflows/build-version.yaml index f6c538a..2edaa78 100644 --- a/.github/workflows/build-version.yaml +++ b/.github/workflows/build-version.yaml @@ -40,7 +40,7 @@ jobs: run: | Set-Item -Path Env:CGO_LDFLAGS -Value "-LD:/a/lunii-admin/lunii-admin/bindings/windows/lib" Set-Item -Path Env:CGO_CFLAGS -Value "-ID:/a/lunii-admin/lunii-admin/bindings/windows/include" - wails build -o lunii-admin_windows_amd64.exe -ldflags "-v '-extldflags=-static -lm'" + go generate && wails build -o lunii-admin_windows_amd64.exe -ldflags "-v '-extldflags=-static -lm'" - uses: ncipollo/release-action@v1 with: @@ -84,7 +84,7 @@ jobs: run: go install github.com/wailsapp/wails/v2/cmd/wails@latest - name: Build - run: wails build -o lunii-admin_linux_amd64 + run: go generate && wails build -o lunii-admin_linux_amd64 - uses: ncipollo/release-action@v1 with: @@ -127,7 +127,7 @@ jobs: run: go install github.com/wailsapp/wails/v2/cmd/wails@latest - name: Build - run: wails build + run: go generate && wails build - name: Create Zip run: ditto -c -k --sequesterRsrc --keepParent build/bin/lunii-admin.app lunii-admin_darwin_amd64.zip diff --git a/.gitignore b/.gitignore index 311954b..3c78975 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ node_modules .DS_Store build/bin build/darwin +version.txt diff --git a/app.go b/app.go index 54563bd..141be60 100644 --- a/app.go +++ b/app.go @@ -2,20 +2,31 @@ package main import ( "context" + _ "embed" "fmt" "log" "os" "path/filepath" + goruntime "runtime" + "strings" "github.com/blang/semver" + "github.com/denisbrodbeck/machineid" "github.com/google/uuid" "github.com/rhysd/go-github-selfupdate/selfupdate" "github.com/olup/lunii-cli/pkg/lunii" studiopackbuilder "github.com/olup/lunii-cli/pkg/pack-builder" "github.com/wailsapp/wails/v2/pkg/runtime" + + "github.com/getsentry/sentry-go" ) +//go:generate bash scripts/get-version.sh +//go:embed version.txt +var version string +var machineId, _ = machineid.ID() + // App struct type App struct { ctx context.Context @@ -27,9 +38,34 @@ func NewApp() *App { func (a *App) startup(ctx context.Context) { a.ctx = ctx + + // Sentry config + err := sentry.Init(sentry.ClientOptions{ + Dsn: "https://1c80a20fce80413db1008a4d4dc4a06d@o1341821.ingest.sentry.io/6615295", + // Set TracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production, + TracesSampleRate: 1.0, + AttachStacktrace: true, + Environment: "production", + }) + if err != nil { + log.Fatalf("sentry.Init: %s", err) + } + + sentry.ConfigureScope(func(scope *sentry.Scope) { + scope.SetContext("infos", map[string]interface{}{ + "version": version, + "machineId": machineId, + }) + }) + + sentry.CaptureMessage("initial-event") } func (a *App) GetDeviceInfos() *lunii.Device { + defer sentry.Recover() + device, err := lunii.GetDevice() if err != nil { return nil @@ -38,6 +74,8 @@ func (a *App) GetDeviceInfos() *lunii.Device { } func (a *App) ListPacks() []lunii.Metadata { + defer sentry.Recover() + device, err := lunii.GetDevice() if err != nil { return nil @@ -50,6 +88,8 @@ func (a *App) ListPacks() []lunii.Metadata { } func (a *App) RemovePack(uuid uuid.UUID) (bool, error) { + defer sentry.Recover() + device, err := lunii.GetDevice() if err != nil { return false, err @@ -69,6 +109,8 @@ func (a *App) RemovePack(uuid uuid.UUID) (bool, error) { } func (a *App) CreatePack(directoryPath string, destinationPath string) (string, error) { + defer sentry.Recover() + _, err := studiopackbuilder.CreateStudioPack(directoryPath, destinationPath) if err != nil { return "", err @@ -77,6 +119,8 @@ func (a *App) CreatePack(directoryPath string, destinationPath string) (string, } func (a *App) OpenDirectory(title string) string { + defer sentry.Recover() + path, _ := runtime.OpenDirectoryDialog(a.ctx, runtime.OpenDialogOptions{ Title: title, }) @@ -84,6 +128,8 @@ func (a *App) OpenDirectory(title string) string { } func (a *App) SaveFile(title string, defaultDirectory string, defaultFileName string) string { + defer sentry.Recover() + fmt.Println("Select save path - options : ", defaultDirectory, defaultFileName) path, _ := runtime.SaveFileDialog(a.ctx, runtime.SaveDialogOptions{ Title: title, @@ -94,6 +140,8 @@ func (a *App) SaveFile(title string, defaultDirectory string, defaultFileName st } func (a *App) OpenFile(title string) string { + defer sentry.Recover() + path, _ := runtime.OpenFileDialog(a.ctx, runtime.OpenDialogOptions{ Title: title, }) @@ -101,6 +149,7 @@ func (a *App) OpenFile(title string) string { } func (a *App) InstallPack(packPath string) (string, error) { + defer sentry.Recover() device, err := lunii.GetDevice() studioPack, err := lunii.ReadStudioPack(packPath) @@ -117,6 +166,7 @@ func (a *App) InstallPack(packPath string) (string, error) { } func (a *App) ChangePackOrder(uuid uuid.UUID, index int) (string, error) { + defer sentry.Recover() fmt.Println("Moving ", uuid, index) @@ -136,6 +186,8 @@ func (a *App) ChangePackOrder(uuid uuid.UUID, index int) (string, error) { } func (a *App) SyncLuniiStoreMetadata(uuids []uuid.UUID) (string, error) { + defer sentry.Recover() + device, err := lunii.GetDevice() if err != nil { return "", err @@ -154,6 +206,8 @@ func (a *App) SyncLuniiStoreMetadata(uuids []uuid.UUID) (string, error) { } func (a *App) SyncStudioMetadata(uuids []uuid.UUID, dbPath string) (string, error) { + defer sentry.Recover() + device, err := lunii.GetDevice() if err != nil { return "", err @@ -171,17 +225,65 @@ func (a *App) SyncStudioMetadata(uuids []uuid.UUID, dbPath string) (string, erro return "", nil } -func (a *App) CheckForUpdate() (bool, string, string) { +type CheckUpdateResponse struct { + CanUpdate bool `json:"canUpdate"` + LatestVersion string `json:"latestVersion"` + ReleaseNotes string `json:"releaseNotes"` +} + +func (a *App) CheckForUpdate() (*CheckUpdateResponse, error) { + defer sentry.Recover() + latest, found, err := selfupdate.DetectLatest("olup/lunii-admin") - v := semver.MustParse("0.0.3") + + trimmedVersion := strings.TrimPrefix(version, "v") + trimmedVersion = strings.TrimSuffix(trimmedVersion, "\n") + + if trimmedVersion == "next" { + return &CheckUpdateResponse{ + CanUpdate: false, + LatestVersion: "", + ReleaseNotes: "", + }, nil + } + + v := semver.MustParse(trimmedVersion) + if err != nil { log.Println("Error occurred while detecting version:", err) - return false, "", "" + return nil, err } if !found || latest.Version.LTE(v) { log.Println("Current version is the latest") - return false, "", "" + return &CheckUpdateResponse{ + CanUpdate: false, + LatestVersion: "", + ReleaseNotes: "", + }, nil } - return true, latest.Version.String(), latest.ReleaseNotes + + return &CheckUpdateResponse{ + CanUpdate: true, + LatestVersion: latest.Version.String(), + ReleaseNotes: latest.ReleaseNotes, + }, nil +} + +type Infos struct { + Version string `json:"version"` + MachineId string `json:"machineId"` + Os string `json:"os"` + Arch string `json:"arch"` +} + +func (a *App) GetInfos() (*Infos, error) { + defer sentry.Recover() + + return &Infos{ + Version: version, + MachineId: machineId, + Os: goruntime.GOOS, + Arch: goruntime.GOARCH, + }, nil } diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index e425f62..db556bc 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,82 +1,62 @@ -import { Box, Button, Center, Icon, Text, Tooltip } from "@chakra-ui/react"; -import { useQuery } from "@tanstack/react-query"; +import { Box, Button, Center, Icon, Text } from "@chakra-ui/react"; import { BiPlug } from "react-icons/bi"; -import { - FiPackage, - FiRefreshCcw, - FiSmartphone, - FiUpload, -} from "react-icons/fi"; -import { Link, Route } from "wouter"; -import { ListPacks } from "../wailsjs/go/main/App"; +import { Route } from "wouter"; import { DetailsModal } from "./components/DetailsModal"; -import { DeviceModal } from "./components/DeviceModal"; +import { AboutModal } from "./components/AboutModal"; import { Header } from "./components/Header"; -import { IsInstallingModal } from "./components/IsInstallingModal"; import { NewPackModal } from "./components/NewPackModal"; import { PackList } from "./components/PackList"; -import { SyncMdMenu } from "./components/SyncMdMenu"; +import { UpdateModal } from "./components/UpdateModal"; import { useDeviceQuery } from "./hooks/useApi"; -import { useInstallPack } from "./hooks/useInstallPack"; +import { FiRefreshCcw } from "react-icons/fi"; function App() { const { data: device, - refetch: refetchDevice, isLoading: isLoadingDevice, + refetch: refetchDevice, } = useDeviceQuery(); if (isLoadingDevice) return null; return ( - + - - + + + + + - {!device && ( - <> - - - - - - - + +
+ {device && ( + + -
- + )} - No device connected + {!device && ( +
+ + + No device connected + +
- - )} - - {device && ( - -
- - - )} + )} + ); } diff --git a/frontend/src/components/AboutModal.tsx b/frontend/src/components/AboutModal.tsx new file mode 100644 index 0000000..e8c4d68 --- /dev/null +++ b/frontend/src/components/AboutModal.tsx @@ -0,0 +1,107 @@ +import { + Badge, + Box, + Button, + Code, + Divider, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalFooter, + ModalHeader, + ModalOverlay, + Progress, + Text, +} from "@chakra-ui/react"; +import { useQuery } from "@tanstack/react-query"; +import { FC, version } from "react"; +import { useLocation, useRoute } from "wouter"; +import { GetDeviceInfos } from "../../wailsjs/go/main/App"; +import { + useDeviceQuery, + useGetInfosQuery, + useUpdateQuery, +} from "../hooks/useApi"; +import { formatBytes } from "../utils"; + +export const AboutModal: FC = () => { + const { data: device } = useDeviceQuery(); + const { data: infos } = useGetInfosQuery(); + const { data: update } = useUpdateQuery(); + const [_, setLocation] = useLocation(); + + return ( + <> + setLocation("/")}> + + + About + + {device && ( + <> + + + + Lunii + + + Serial Number {device.serialNumber} + + + Version{" "} + + {device.firmwareVersionMajor}. + {device.firmwareVersionMinor} + + + + Space{" "} + + {formatBytes(device.diskUsage.used)} /{" "} + {formatBytes(device.diskUsage.free)} + + + + + + )} + + + + Software + + + Version {infos?.version} + + + Computer ID {infos?.machineId} + + + {update?.canUpdate && ( + <> + + + + New version + + A new version is available + + Very soon you'll be able to trigger the update from here + + + + )} + + + + + + + ); +}; diff --git a/frontend/src/components/DeviceModal.tsx b/frontend/src/components/DeviceModal.tsx deleted file mode 100644 index e8c6643..0000000 --- a/frontend/src/components/DeviceModal.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import { - Box, - Button, - Code, - Modal, - ModalBody, - ModalCloseButton, - ModalContent, - ModalFooter, - ModalHeader, - ModalOverlay, - Progress, - Text, -} from "@chakra-ui/react"; -import { useQuery } from "@tanstack/react-query"; -import { FC } from "react"; -import { useLocation, useRoute } from "wouter"; -import { GetDeviceInfos } from "../../wailsjs/go/main/App"; -import { useDeviceQuery } from "../hooks/useApi"; -import { formatBytes } from "../utils"; - -export const DeviceModal: FC = () => { - const { data: device } = useDeviceQuery(); - const [_, setLocation] = useLocation(); - - if (!device) return null; - - return ( - <> - setLocation("/")}> - - - My Lunii - - - - Serial Number {device.serialNumber} - - - Version{" "} - - {device.firmwareVersionMajor}.{device.firmwareVersionMinor} - - - - Space{" "} - - {formatBytes(device.diskUsage.used)} /{" "} - {formatBytes(device.diskUsage.free)} - - - - - - - - - - - ); -}; diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index d2ead2d..abec13c 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -1,13 +1,17 @@ import { Button, Box } from "@chakra-ui/react"; -import { FiSmartphone, FiUpload, FiPackage } from "react-icons/fi"; +import { FiSmartphone, FiUpload, FiPackage, FiInfo } from "react-icons/fi"; import { Link } from "wouter"; import { useInstallPack } from "../hooks/useInstallPack"; import { IsInstallingModal } from "./IsInstallingModal"; import { SyncMdMenu } from "./SyncMdMenu"; +import { useDeviceQuery, useUpdateQuery } from "../hooks/useApi"; export const Header = () => { + const { data: device } = useDeviceQuery(); + const { data: update } = useUpdateQuery(); const { mutate: handleInstallPack, isLoading: isInstalling } = useInstallPack(); + return ( { > - + - - - - + {device && ( + <> + + + + + + )} + + + {update?.canUpdate && ( + + + + )} ); }; diff --git a/frontend/src/components/UpdateModal.tsx b/frontend/src/components/UpdateModal.tsx new file mode 100644 index 0000000..f733374 --- /dev/null +++ b/frontend/src/components/UpdateModal.tsx @@ -0,0 +1,55 @@ +import { + Box, + Button, + Code, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalFooter, + ModalHeader, + ModalOverlay, + Progress, + Text, +} from "@chakra-ui/react"; +import { useQuery } from "@tanstack/react-query"; +import { FC } from "react"; +import { Link, useLocation, useRoute } from "wouter"; +import { CheckForUpdate, GetDeviceInfos } from "../../wailsjs/go/main/App"; +import { useDeviceQuery, useUpdateQuery } from "../hooks/useApi"; +import { formatBytes } from "../utils"; + +export const UpdateModal: FC = () => { + const [location, setLocation] = useLocation(); + const { data } = useUpdateQuery(); + + return ( + <> + setLocation("/")}> + + + Update available + + + A new version of this tool is available. + + Very soon this will let you self-update. Until this time, you + can download the latest version from the github repo. + + + + Version {data?.latestVersion} + + {data?.releaseNotes && ( + + {data.releaseNotes} + + )} + + + + + + + ); +}; diff --git a/frontend/src/hooks/useApi.ts b/frontend/src/hooks/useApi.ts index df37bc2..e3c3683 100644 --- a/frontend/src/hooks/useApi.ts +++ b/frontend/src/hooks/useApi.ts @@ -1,7 +1,21 @@ import { useQuery } from "@tanstack/react-query"; -import { GetDeviceInfos } from "../../wailsjs/go/main/App"; +import { + CheckForUpdate, + GetDeviceInfos, + GetInfos, +} from "../../wailsjs/go/main/App"; export const useDeviceQuery = () => useQuery(["device"], GetDeviceInfos, { staleTime: Infinity, }); + +export const useUpdateQuery = () => + useQuery(["update"], CheckForUpdate, { + cacheTime: Infinity, + }); + +export const useGetInfosQuery = () => + useQuery(["infos"], GetInfos, { + cacheTime: Infinity, + }); diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/main/App.d.ts index da7b254..a036897 100755 --- a/frontend/wailsjs/go/main/App.d.ts +++ b/frontend/wailsjs/go/main/App.d.ts @@ -1,16 +1,19 @@ // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // This file is automatically generated. DO NOT EDIT import {uuid} from '../models'; +import {main} from '../models'; import {lunii} from '../models'; export function ChangePackOrder(arg1:uuid.UUID,arg2:number):Promise; -export function CheckForUpdate():Promise; +export function CheckForUpdate():Promise; export function CreatePack(arg1:string,arg2:string):Promise; export function GetDeviceInfos():Promise; +export function GetInfos():Promise; + export function InstallPack(arg1:string):Promise; export function ListPacks():Promise>; diff --git a/frontend/wailsjs/go/main/App.js b/frontend/wailsjs/go/main/App.js index 14566f9..8c51fec 100755 --- a/frontend/wailsjs/go/main/App.js +++ b/frontend/wailsjs/go/main/App.js @@ -18,6 +18,10 @@ export function GetDeviceInfos() { return window['go']['main']['App']['GetDeviceInfos'](); } +export function GetInfos() { + return window['go']['main']['App']['GetInfos'](); +} + export function InstallPack(arg1) { return window['go']['main']['App']['InstallPack'](arg1); } diff --git a/frontend/wailsjs/go/models.ts b/frontend/wailsjs/go/models.ts index 5dd9fd4..25faf6a 100755 --- a/frontend/wailsjs/go/models.ts +++ b/frontend/wailsjs/go/models.ts @@ -1,3 +1,42 @@ +export namespace main { + + export class CheckUpdateResponse { + canUpdate: boolean; + latestVersion: string; + releaseNotes: string; + + static createFrom(source: any = {}) { + return new CheckUpdateResponse(source); + } + + constructor(source: any = {}) { + if ('string' === typeof source) source = JSON.parse(source); + this.canUpdate = source["canUpdate"]; + this.latestVersion = source["latestVersion"]; + this.releaseNotes = source["releaseNotes"]; + } + } + export class Infos { + version: string; + machineId: string; + os: string; + arch: string; + + static createFrom(source: any = {}) { + return new Infos(source); + } + + constructor(source: any = {}) { + if ('string' === typeof source) source = JSON.parse(source); + this.version = source["version"]; + this.machineId = source["machineId"]; + this.os = source["os"]; + this.arch = source["arch"]; + } + } + +} + export namespace lunii { export class DiskUsage { diff --git a/go.mod b/go.mod index 1f87ee3..cf3ecb2 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,8 @@ go 1.17 require ( github.com/blang/semver v3.5.1+incompatible + github.com/denisbrodbeck/machineid v1.0.1 + github.com/getsentry/sentry-go v0.13.0 github.com/google/uuid v1.3.0 github.com/olup/lunii-cli v0.0.0-20220727052208-9ff36a20c348 github.com/rhysd/go-github-selfupdate v1.2.3 diff --git a/go.sum b/go.sum index da388ef..7acb022 100644 --- a/go.sum +++ b/go.sum @@ -29,6 +29,8 @@ github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMSRhl4D7AQ= +github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI= github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= @@ -39,8 +41,11 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/getsentry/sentry-go v0.13.0 h1:20dgTiUSfxRB/EhMPtxcL9ZEbM1ZdR+W/7f7NWD+xWo= +github.com/getsentry/sentry-go v0.13.0/go.mod h1:EOsfu5ZdvKPfeHYV6pTVQnsjfp30+XA7//UooKNumH0= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= @@ -170,8 +175,6 @@ github.com/nwaples/rardecode/v2 v2.0.0-beta.2/go.mod h1:yntwv/HfMc/Hbvtq9I19D1n5 github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/olup/lunii-cli v0.0.0-20220727052208-9ff36a20c348 h1:srwA+Cs1YBZdbwlK6YGQDLrqZEcpYfgDErNCUV4/pNM= -github.com/olup/lunii-cli v0.0.0-20220727052208-9ff36a20c348/go.mod h1:oSGXGkGLrEr8iSTZzIakQ4pHyKhEbltFUhKh0s60csA= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -194,6 +197,7 @@ github.com/otiai10/mint v1.3.3 h1:7JgpsBaN0uMkyju4tbYHu0mnM55hNKVYLsXmwr15NQI= github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= diff --git a/scripts/get-version.sh b/scripts/get-version.sh new file mode 100755 index 0000000..910a1f0 --- /dev/null +++ b/scripts/get-version.sh @@ -0,0 +1,2 @@ +#!/bin/bash +git describe --tags --abbrev=0 >version.txt