-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvim_run.js
More file actions
61 lines (53 loc) · 1.67 KB
/
vim_run.js
File metadata and controls
61 lines (53 loc) · 1.67 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
var wsh = new ActiveXObject("WScript.Shell");
var env = wsh.Environment('SYSTEM');
var fso = new ActiveXObject("Scripting.FileSystemObject");
var vimPath = fso.getParentFolderName(WScript.ScriptFullName) + "\\";
// var vimPath = wsh.CurrentDirectory + "\\";
// wsh.Popup(vimPath, 0, "vimPath", 1);
wsh.run(vimPath + "mkdir_temp.bat",0, true);
wsh.run(vimPath + "mklink_settings.bat",0, true);
wsh.run(vimPath + "git_cloning.bat",0, true);
wsh.run(vimPath + "vim_right_command_regist.bat",0, true);
var objParam = WScript.Arguments;
var strErrorMessage = "";
var strVimExecCommand = vimPath;
var strMicroprocessor = env.item('PROCESSOR_ARCHITECTURE');
if (strMicroprocessor == "x86"){
// 32bit Vim;
if (objParam.length == 0){
strVimExecCommand += "vim74-kaoriya-win64\\gvim.exe";
}
else if (objParam(0) === "vim"){
strVimExecCommand += "vim74-kaoriya-win32\\vim.exe";
}
else if (objParam(0) === "gvim"){
strVimExecCommand += "vim74-kaoriya-win32\\gvim.exe";
}
else {
strErrorMessage = "コマンドライン引数が不正です。";
}
}
else if (strMicroprocessor == "AMD64"){
// 64bit Vim;
if (objParam.length === 0){
strVimExecCommand += "vim74-kaoriya-win64\\gvim.exe";
}
else if (objParam(0) === "vim"){
strVimExecCommand += "vim74-kaoriya-win64\\vim.exe";
}
else if (objParam(0) === "gvim"){
strVimExecCommand += "vim74-kaoriya-win64\\gvim.exe";
}
else {
strErrorMessage = "コマンドライン引数が不正です。";
}
}
if (strErrorMessage !== ""){
wsh.Popup(strErrorMessage, 0, "起動エラー", 1);
}
else {
if (objParam.length >= 2){
strVimExecCommand += (" " + objParam(1));
}
wsh.run(strVimExecCommand, 1, false);
}