Skip to content

Commit f22a118

Browse files
committed
Remove eslint testing config
1 parent 609dfc6 commit f22a118

File tree

3 files changed

+85
-10
lines changed

3 files changed

+85
-10
lines changed

migrations/src/0_1_0_to_0_1_1.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package main
2+
3+
import (
4+
"os"
5+
"fmt"
6+
"io/ioutil"
7+
"github.com/mickep76/iodatafmt"
8+
)
9+
10+
func main() {
11+
if len(os.Args) < 2 {
12+
fmt.Print("Missing first parameter: file config.{toml,json,yml} path")
13+
os.Exit(1)
14+
}
15+
path := os.Args[1]
16+
if _, err := os.Stat(path); os.IsNotExist(err) {
17+
panic(fmt.Errorf("Unable to find config file using path \"%s\", %s", path, err))
18+
}
19+
f, err := iodatafmt.FileFormat(path)
20+
if err != nil {
21+
panic(fmt.Errorf("Unable to determine format of given config file \"%s\", %s", path, err))
22+
}
23+
d, err := iodatafmt.Load(path, f)
24+
if err != nil {
25+
panic(fmt.Errorf("Unable to read config from given file \"%s\", %s", path, err))
26+
}
27+
if val, ok := d.(map[string]interface {})["googleAnalytics"]; ok {
28+
fmt.Printf("googleAnalytics value already exists with: \"%s\"! No migration applied", val)
29+
os.Exit(0)
30+
}
31+
if _, ok := d.(map[string]interface {})["params"]; ok {
32+
if val, ok := d.(map[string]interface {})["params"].(map[string]interface {})["google_analytics_id"]; ok {
33+
fmt.Printf("Migrate\n=======\n\n[params]\n\tgoogle_analytics_id = %s\n\nto\n\ngoogleAnalytics = %s\n\n", val, val)
34+
d.(map[string]interface {})["googleAnalytics"] = val
35+
delete(d.(map[string]interface {})["params"].(map[string]interface {}), "google_analytics_id")
36+
}
37+
}
38+
m, err := iodatafmt.Marshal(d, f)
39+
if err != nil {
40+
panic(fmt.Errorf("Unable to marshal config, %s", err))
41+
}
42+
ioutil.WriteFile(path + ".new", m, 0644)
43+
fmt.Printf("New configuration has been generated on %s", path + ".new")
44+
}

migrations/src/0_1_1_to_0_1_2.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package main
2+
3+
import (
4+
"os"
5+
"fmt"
6+
"github.com/mickep76/iodatafmt"
7+
"io/ioutil"
8+
)
9+
10+
func main() {
11+
if len(os.Args) < 2 {
12+
fmt.Print("Missing first parameter: file config.{toml,json,yml} path")
13+
os.Exit(1)
14+
}
15+
path := os.Args[1]
16+
if _, err := os.Stat(path); os.IsNotExist(err) {
17+
panic(fmt.Errorf("Unable to find config file using path \"%s\", %s", path, err))
18+
}
19+
f, err := iodatafmt.FileFormat(path)
20+
if err != nil {
21+
panic(fmt.Errorf("Unable to determine format of given config file \"%s\", %s", path, err))
22+
}
23+
d, err := iodatafmt.Load(path, f)
24+
if err != nil {
25+
panic(fmt.Errorf("Unable to read config from given file \"%s\", %s", path, err))
26+
}
27+
if _, ok := d.(map[string]interface {})["taxonomies"]; ok {
28+
if _, ok := d.(map[string]interface{})["taxonomies"].(map[string]interface{})["archives"]; ok {
29+
fmt.Print("archives taxonomies already exists! No migration applied")
30+
os.Exit(0)
31+
}
32+
fmt.Print("Migrate\n=======\n\n[taxonomies]\n\tarchive = \"archives\"\n\naddded\n\n")
33+
d.(map[string]interface {})["taxonomies"].(map[string]interface{})["archives"] = "archive"
34+
}
35+
m, err := iodatafmt.Marshal(d, f)
36+
if err != nil {
37+
panic(fmt.Errorf("Unable to marshal config, %s", err))
38+
}
39+
ioutil.WriteFile(path + ".new", m, 0644)
40+
fmt.Printf("New configuration has been generated on %s", path + ".new")
41+
}

tasks/config/eslint.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)