Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Wabri committed Jun 24, 2024
1 parent 3a6be66 commit 0f7054b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ bin
# Mac
.DS_Store
dist/

# DAJE
testdata
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ build: clean
build-test-dev: clean
@echo "\n----- Start BUILD-TEST-DEV -----\n"
@echo "# Building daje for development environment..."
go build -ldflags "-X github.com/Schrodinger-Hat/Daje/constants.DajeConfigBaseDir=$(CURRENT_DIR)/testdata -X github.com/Schrodinger-Hat/Daje/constants.Version=$(shell git branch --show-current)+$(shell git rev-parse --short origin/main)+$(shell git status --porcelain | wc -l)" -o ./bin/daje .
go build -ldflags "-X github.com/Schrodinger-Hat/Daje/constants.DajeConfigBaseDir=$(CURRENT_DIR)/testdata/.config -X github.com/Schrodinger-Hat/Daje/constants.Version=$(shell git branch --show-current)+$(shell git rev-parse --short origin/main)+$(shell git status --porcelain | wc -l)" -o ./bin/daje .
@echo "\n----- End BUILD-TEST-DEV -----"

checkhealth: build-test-dev
Expand Down
4 changes: 4 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (
"github.com/Schrodinger-Hat/Daje/constants"

Check failure on line 8 in internal/config/config.go

View workflow job for this annotation

GitHub Actions / lint

import 'github.com/Schrodinger-Hat/Daje/constants' is not allowed from list 'Main' (depguard)
)

func LoadConfig() error {
return nil
}

func InitEmptyDaje() error {
dajeConfigPath := filepath.Join(constants.DajeConfigBaseDir)

Check failure on line 16 in internal/config/config.go

View workflow job for this annotation

GitHub Actions / lint

badCall: suspicious Join on 1 argument (gocritic)
if err := os.Mkdir(dajeConfigPath, 0755); err != nil {
Expand Down
3 changes: 3 additions & 0 deletions pkg/cmd/checkhealth/checkhealth.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/spf13/cobra"

Check failure on line 6 in pkg/cmd/checkhealth/checkhealth.go

View workflow job for this annotation

GitHub Actions / lint

import 'github.com/spf13/cobra' is not allowed from list 'Main' (depguard)

"github.com/Schrodinger-Hat/Daje/constants"

Check failure on line 8 in pkg/cmd/checkhealth/checkhealth.go

View workflow job for this annotation

GitHub Actions / lint

import 'github.com/Schrodinger-Hat/Daje/constants' is not allowed from list 'Main' (depguard)
"github.com/Schrodinger-Hat/Daje/internal/config"

Check failure on line 9 in pkg/cmd/checkhealth/checkhealth.go

View workflow job for this annotation

GitHub Actions / lint

import 'github.com/Schrodinger-Hat/Daje/internal/config' is not allowed from list 'Main' (depguard)
"github.com/Schrodinger-Hat/Daje/internal/tuning"

Check failure on line 10 in pkg/cmd/checkhealth/checkhealth.go

View workflow job for this annotation

GitHub Actions / lint

import 'github.com/Schrodinger-Hat/Daje/internal/tuning' is not allowed from list 'Main' (depguard)
)

Expand All @@ -25,6 +26,8 @@ func submitAction() error {

fmt.Println("Version: ", constants.Version)
fmt.Println("Configuration path: ", constants.DajeDotfilePath)
config.LoadConfig()

Check failure on line 29 in pkg/cmd/checkhealth/checkhealth.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `config.LoadConfig` is not checked (errcheck)
fmt.Println("Flows path: ", constants.DajeDotfilePath)
fmt.Println("Tuning: ", tuning.IsSystemTuned())

return nil
Expand Down
1 change: 1 addition & 0 deletions testdata/.config/daje/daje.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flows_directory: "flows"
5 changes: 5 additions & 0 deletions testdata/.config/daje/flows/file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: create file testdata/file-result.txt
file:
action: new
path: testdata/file-result.txt

0 comments on commit 0f7054b

Please sign in to comment.