Skip to content

Commit c3ce8d6

Browse files
committed
fix: include portable dir
1 parent 199ff5c commit c3ce8d6

File tree

1 file changed

+7
-5
lines changed
  • _automation/treesitter_updater

1 file changed

+7
-5
lines changed

_automation/treesitter_updater/main.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ import (
1616
)
1717

1818
// Constants for the Tree Sitter version and download URL
19-
const sitterVersion = "0.25.9"
20-
const sitterURL = "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v" + sitterVersion + ".tar.gz"
19+
const (
20+
sitterVersion = "0.25.9"
21+
sitterURL = "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v" + sitterVersion + ".tar.gz"
22+
)
2123

2224
func main() {
2325
// Get the current working directory
@@ -40,6 +42,7 @@ func main() {
4042
copyFiles(filepath.Join(parentPath, "lib", "src"), filepath.Join(currentDir, "tmpts"), "*.c")
4143
copyFiles(filepath.Join(parentPath, "lib", "src"), filepath.Join(currentDir, "tmpts"), "*.h")
4244
copyFiles(filepath.Join(parentPath, "lib", "src", "unicode"), filepath.Join(currentDir, "tmpts"), "*.h")
45+
copyFiles(filepath.Join(parentPath, "lib", "src", "portable"), filepath.Join(currentDir, "tmpts"), "*.h")
4346

4447
// Remove the original extracted directory
4548
err = os.RemoveAll(parentPath)
@@ -125,7 +128,7 @@ func copyFile(src, dst string) error {
125128
}
126129

127130
// Write the file to destination
128-
err = ioutil.WriteFile(dst, input, 0644)
131+
err = ioutil.WriteFile(dst, input, 0o644)
129132
if err != nil {
130133
return err
131134
}
@@ -196,7 +199,7 @@ func downloadAndExtractSitter(url, version string) error {
196199
// Create directories and files as needed
197200
switch header.Typeflag {
198201
case tar.TypeDir:
199-
if err := os.MkdirAll(target, 0755); err != nil {
202+
if err := os.MkdirAll(target, 0o755); err != nil {
200203
return err
201204
}
202205
case tar.TypeReg:
@@ -230,7 +233,6 @@ func cleanup(path string) {
230233
}
231234
return nil
232235
})
233-
234236
if err != nil {
235237
// Handle the error
236238
}

0 commit comments

Comments
 (0)