Fix issues with Repository synchronization tool (#124)
* Only run tests in build/sync if directory exists * Use t.Helper() * Don't compare size of directories * Fix TestFileHistory * Fix linter issue * Apply changes from https://github.com/mattermost/mattermost-plugin-github/pull/345 * Use ts file for tests * Add sync target
This commit is contained in:
parent
0688e8df4c
commit
dcaf9dd289
11 changed files with 776 additions and 12 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/pkg/errors"
|
||||
|
@ -122,6 +123,7 @@ func applyManifest(manifest *model.Manifest) error {
|
|||
return err
|
||||
}
|
||||
manifestStr := string(manifestBytes)
|
||||
manifestStr = strings.ReplaceAll(manifestStr, "\\n", "\\\n")
|
||||
|
||||
// write generated code to file by using Go file template.
|
||||
if err := ioutil.WriteFile(
|
||||
|
@ -145,7 +147,7 @@ func applyManifest(manifest *model.Manifest) error {
|
|||
|
||||
// write generated code to file by using JS file template.
|
||||
if err := ioutil.WriteFile(
|
||||
"webapp/src/manifest.js",
|
||||
"webapp/src/manifest.ts",
|
||||
[]byte(fmt.Sprintf(pluginIDJSFileTemplate, manifestStr)),
|
||||
0600,
|
||||
); err != nil {
|
||||
|
|
Reference in a new issue