Created
February 24, 2021 03:12
-
-
Save apoorvmote/a6cc98efe01bde07661ad50cc452400b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://taskfile.dev | |
version: '3' | |
includes: | |
project1: | |
taskfile: ./project1/Taskfile.yml | |
dir: ./project1 | |
project2: | |
taskfile: ./project2/Taskfile.yml | |
dir: ./project2 | |
project3: | |
taskfile: ./project3/Taskfile.yml | |
dir: ./project3 | |
tasks: | |
default: | |
cmds: | |
- task project1:update | |
- task project2:update | |
- task project3:update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io/ioutil" | |
"os" | |
) | |
func main() { | |
old := "1.83.0" | |
new := "1.84.0" | |
paths := []string{ | |
"./project1/package.json", | |
"./project2/package.json", | |
"./project3/package.json", | |
} | |
for _, path := range paths { | |
input, err := ioutil.ReadFile(path) | |
if err != nil { | |
fmt.Println(err) | |
os.Exit(1) | |
} | |
output := bytes.Replace(input, []byte(old), []byte(new), -1) | |
err = ioutil.WriteFile(path, output, 0644) | |
if err != nil { | |
fmt.Println(err) | |
os.Exit(1) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://taskfile.dev | |
version: '3' | |
tasks: | |
update: | |
cmds: | |
- rm -rf node_modules/ | |
- npm i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
old := "1.83.0" | |
new := "1.84.0" | |
old1 := "0.83.0" | |
new1 := "0.84.0" | |
... | |
output := bytes.Replace(input, []byte(old), []byte(new), -1) | |
output1 := bytes.Replace(input, []byte(old1), []byte(new1), -1) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment