Skip to content

Commit

Permalink
z2451 - support absolute path for import script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Saidl committed Oct 12, 2022
1 parent 5223253 commit 8802499
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.12.14] - 2022-10-12

### Fixed
- support absolute path for import script

## [v0.12.13] - 2022-10-06

### Fixed
Expand Down
14 changes: 9 additions & 5 deletions src/cliAction/importProjectService/yamlContent.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ import (
func getImportYamlContent(config RunConfig) ([]byte, error) {
fmt.Println(i18n.YamlCheck)

workingDir, err := filepath.Abs(config.WorkingDir)
if err != nil {
return nil, err
}
importYamlPath := config.ImportYamlPath
if !filepath.IsAbs(importYamlPath) {

importYamlPath := filepath.Join(workingDir, config.ImportYamlPath)
workingDir, err := filepath.Abs(config.WorkingDir)
if err != nil {
return nil, err
}

importYamlPath = filepath.Join(workingDir, importYamlPath)
}

fileInfo, err := os.Stat(importYamlPath)
if err != nil {
Expand Down

0 comments on commit 8802499

Please sign in to comment.