Skip to content

Commit fac2e30

Browse files
committed
update license script
1 parent 0abfab7 commit fac2e30

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

examples/websocket/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Copyright 2019-2020 Axetroy. All rights reserved. Apache License 2.0.
12
package main
23

34
import (

main.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Copyright 2019-2020 Axetroy. All rights reserved. Apache License 2.0.
12
package terminal
23

34
const (

scripts/license_file_header.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55

66
import os
77

8+
exclude = {"node_modules", "vendor", ".nuxt", "scripts"}
9+
810

911
def walk(root_dir):
10-
for root, dirs, files in os.walk(root_dir, topdown=False):
12+
for root, dirs, files in os.walk(root_dir, topdown=True):
13+
dirs[:] = [d for d in dirs if d not in exclude]
1114
for filename in files:
12-
if filename == "node_modules" or filename == "vendor":
13-
continue
15+
filepath = os.path.join(root, filename)
1416

1517
if os.path.splitext(filename)[-1] == ".go":
16-
filepath = os.path.join(root, filename)
17-
1818
with open(filepath, "r") as reader:
1919
originContent = reader.read()
2020
reader.close()
@@ -24,8 +24,6 @@ def walk(root_dir):
2424
writer.write(originContent)
2525

2626
elif os.path.splitext(filename)[-1] == ".js":
27-
filepath = os.path.join(root, filename)
28-
2927
with open(filepath, "r") as reader:
3028
originContent = reader.read()
3129
reader.close()
@@ -35,8 +33,6 @@ def walk(root_dir):
3533
writer.write(originContent)
3634

3735
elif os.path.splitext(filename)[-1] == ".vue":
38-
filepath = os.path.join(root, filename)
39-
4036
with open(filepath, "r") as reader:
4137
originContent = reader.read()
4238
reader.close()
@@ -47,6 +43,4 @@ def walk(root_dir):
4743
writer.write(originContent)
4844

4945

50-
walk("./internal")
51-
walk("./cmd")
52-
walk("./frontend")
46+
walk(".")

0 commit comments

Comments
 (0)