Skip to content

Commit 0a942df

Browse files
committed
Replace shell script with python script
1 parent 51da7c8 commit 0a942df

File tree

8 files changed

+22
-7
lines changed

8 files changed

+22
-7
lines changed

.github/workflows/ts-pages.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ jobs:
1717
uses: actions/checkout@v4
1818
- name: Build TypeScript
1919
run: tsc
20-
- run: bash .sh
20+
- name: Run custom build script script
21+
run: python3 build.py
2122
- name: Compress & Upload pages artifact
2223
uses: actions/upload-pages-artifact@v3
2324
with:
24-
path: "."
25+
path: "./www" # Website root
2526

2627
deploy:
2728
runs-on: ubuntu-latest

.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

build.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os
2+
import shutil
3+
4+
for dir, subdirs, files in os.walk("./www"):
5+
if (not subdirs and not files) or (
6+
all([file.startswith(".") for file in files])
7+
and all([subdir.startswith(".") for subdir in subdirs])
8+
):
9+
shutil.rmtree(dir)
10+
continue
11+
12+
for file in files:
13+
if file.startswith(".") or file.endswith(".ts"):
14+
os.remove(file)
15+
continue

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
5656
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
5757
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58-
"outDir": "./_js", /* Specify an output folder for all emitted files. */
58+
// "outDir": "./", /* Specify an output folder for all emitted files. */
5959
// "removeComments": true, /* Disable emitting comments. */
6060
// "noEmit": true, /* Disable emitting files from a compilation. */
6161
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
@@ -64,7 +64,7 @@
6464
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
6565
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
6666
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
67-
"newLine": "crlf", /* Set the newline character for emitting files. */
67+
"newLine": "crlf", /* Set the newline character for emitting files. */
6868
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
6969
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
7070
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */

index.html renamed to www/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
</head>
88
<body>
99
<button>Hello, World!</button>
10-
<script src="_js/index.js"></script>
10+
<script src="ts/index.js"></script>
1111
</body>
1212
</html>

www/ts/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/*.js
File renamed without changes.

0 commit comments

Comments
 (0)