-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
37 lines (36 loc) · 1.02 KB
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import $ from "@david/dax";
async function main() {
const config = {
virsion: "0.1.2.1"
}
const denoJson = await Deno.readTextFile("./deno.json");
const denoJsonObj = JSON.parse(denoJson);
const version = denoJsonObj.version;
if(version > config.virsion) {
console.log("This script is old, please use latest update script");
return;
}
if(version === config.virsion) {
console.log("This script is latest version");
return;
}
//gitがインストールされているか確認
const git = await $`git --version`;
if(git.stderr) {
console.log("Please install git");
return;
}
//gitのリポジトリを取得
const gitRemote = await $`git remote -v`;
if(gitRemote.stderr) {
console.log("Please set git remote");
return;
}
//https://github.com/takoserver/takosかどうか確認
if(!gitRemote.stdout.includes("https://github.com/takoserver/takos")) {
console.log("This script is not takos script");
return;
}
console.log("This script is takos script");
}
main();