chore: rename artifacts
This commit is contained in:
@@ -53,7 +53,7 @@ jobs:
|
|||||||
- name: Upload binaries as artifacts
|
- name: Upload binaries as artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: linux-bin
|
name: bin-linux
|
||||||
path: /dist
|
path: /dist
|
||||||
|
|
||||||
prepare-windows:
|
prepare-windows:
|
||||||
@@ -120,7 +120,7 @@ jobs:
|
|||||||
- name: Upload binaries as artifacts
|
- name: Upload binaries as artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: windows-bin
|
name: bin-windows
|
||||||
path: /dist
|
path: /dist
|
||||||
|
|
||||||
compile-linux:
|
compile-linux:
|
||||||
@@ -135,7 +135,7 @@ jobs:
|
|||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: linux-bin
|
name: bin-linux
|
||||||
path: ./bin
|
path: ./bin
|
||||||
|
|
||||||
- name: Setup the Go programming language
|
- name: Setup the Go programming language
|
||||||
@@ -188,7 +188,7 @@ jobs:
|
|||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: windows-bin
|
name: bin-windows
|
||||||
path: ./bin
|
path: ./bin
|
||||||
|
|
||||||
- name: Setup the Go programming language
|
- name: Setup the Go programming language
|
||||||
|
|||||||
@@ -1,15 +1,33 @@
|
|||||||
package setup
|
package setup
|
||||||
|
|
||||||
import "os"
|
import (
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
func PrepareEnvironment() (bool, error) {
|
func PrepareEnvironment() (bool, error) {
|
||||||
if _, err := os.Stat("./bin"); err != nil {
|
ok, err := fsCheck()
|
||||||
return false, err
|
|
||||||
|
return ok, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Stat("./books"); err != nil {
|
func fsCheck() (bool, error) {
|
||||||
|
dirs := []string{"./bin", "./books", "./history"}
|
||||||
|
files := []string{"./api.conf", "./os_categories.json"}
|
||||||
|
|
||||||
|
for _, d := range dirs {
|
||||||
|
if _, err := os.Stat(d); err != nil {
|
||||||
|
log.Printf("Unable to stat dir: %s", d)
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, f := range files {
|
||||||
|
if _, err := os.Stat(f); err != nil {
|
||||||
|
log.Printf("Unable to stat file: %s", f)
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user