Skip to content

Commit

Permalink
move pullTemplatesOutofAuth2Jar into New
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangs18 committed Mar 14, 2024
1 parent 04daa79 commit 8576aab
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/kbaseauthcontroller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@ func New(p Params) (*Controller, error) {
if err != nil {
return nil, err
}
tpath, err := pullTemplatesOutofAuth2Jar(classPath)
if err != nil {
return nil, err
}
tdir := filepath.Join(p.RootTempDir, "AuthController-"+uuid.New().String())
templateDir := filepath.Join(tdir, "templates")
err = os.MkdirAll(templateDir, 0700)
if err != nil {
return nil, err
}
err = installTemplates(classPath, templateDir)
err = installTemplates(tpath, templateDir)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -165,11 +169,7 @@ func pullTemplatesOutofAuth2Jar(classPath string) (string, error) {
return tpath, err
}

func installTemplates(classPath string, templateDir string) error {
tpath, err := pullTemplatesOutofAuth2Jar(classPath)
if err != nil {
return err
}
func installTemplates(tpath string, templateDir string) error {
files, err := ioutil.ReadDir(tpath)
if err != nil {
return err
Expand Down

0 comments on commit 8576aab

Please sign in to comment.