Update install/operator/pkg/syndesis/olm/csv.go
Rather than rely on the 'pkg' directory, check the current working directory instead.
@@ -21,6 +21,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
+ "strings"
"time"
"github.com/syndesisio/syndesis/install/operator/pkg/syndesis/capabilities"
@@ -211,9 +212,13 @@ func (c *csv) build() (err error) {
//
// Ensure the following files can be located
//
- if _, err := os.Stat("pkg"); os.IsNotExist(err) {
+ if cwd, err := os.Getwd(); err != nil {
+ if strings.HasSuffix(cwd, "/install/operator") == false {
return fmt.Errorf("This needs to be executed from the syndesis/install/operator directory.")
}
+ } else {
+ return err
+ }
alm, err := ioutil.ReadFile(filepath.Join("pkg", "syndesis", "olm", "assets", "alm-examples"))
descriptionLong, _ := ioutil.ReadFile(filepath.Join("pkg", "syndesis", "olm", "assets", target, "description"))
