forked from wmathurin/MyUserPicReactNative
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.vbs
More file actions
80 lines (70 loc) · 2.96 KB
/
install.vbs
File metadata and controls
80 lines (70 loc) · 2.96 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Option Explicit
On Error Resume Next
' *** ***
' * *
' * ATTENTION: Windows Users *
' * *
' * Run this script to initialize the submodules of your repository
' * From the command line: cscript install.vbs *
' *** ***
Dim strWorkingDirectory, objShell, intReturnVal
' Set the working folder to the script location (i.e. the repo root)
strWorkingDirectory = GetDirectoryName(WScript.ScriptFullName)
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.CurrentDirectory = strWorkingDirectory
' Initialze and update the submodules.
WScript.Echo "Getting git submodules"
intReturnVal = objShell.Run("git submodule init", 1, True)
If intReturnVal <> 0 Then
WScript.Echo "Error initializing the submodules!"
WScript.Quit 2
End If
intReturnVal = objShell.Run("git submodule sync", 1, True)
If intReturnVal <> 0 Then
WScript.Echo "Error syncing the submodules!"
WScript.Quit 6
End If
intReturnVal = objShell.Run("git submodule update --init --recursive", 1, True)
If intReturnVal <> 0 Then
WScript.Echo "Error updating the submodules!"
WScript.Quit 3
End If
'Install npm dependencies.
WScript.Echo vbCrLf & "Installing npm dependencies"
'The following line is the equivalent of "cd app"
objShell.CurrentDirectory = strWorkingDirectory & "\app"
intReturnVal = objShell.Run("npm install", 1, True)
If intReturnVal <> 0 Then
WScript.Echo "Error in running npm install!"
WScript.Quit 6
End If
'Copy js files to app/js folder'
'The following line is the equivalent of "cd .."
objShell.CurrentDirectory = strWorkingDirectory
WScript.Echo vbCrLf & "Getting js files"
intReturnVal = objShell.Run("copy external\shared\libs\react.* app\js\", 1, True)
If intReturnVal <> 0 Then
WScript.Echo "Error in copying js files!"
WScript.Quit 3
End If
'Run install.vbs on the SalesforceMobileSDK-Android clone
objShell.CurrentDirectory = strWorkingDirectory & "\external\android"
WScript.Echo vbCrLf & "Running install script for SalesforceMobileSDK-Android clone"
intReturnVal = objShell.run("cscript install.vbs", 1, True)
If intReturnVal <> 0 Then
WScript.Echo "Error in running install.vbs for SalesforceMobileSDK-Android clone!"
WScript.Quit 6
End If
WScript.Quit 0
' -------------------------------------------------------------------
' - Gets the directory name, from a file path.
' -------------------------------------------------------------------
Function GetDirectoryName(ByVal strFilePath)
Dim strFinalSlash
strFinalSlash = InStrRev(strFilePath, "\")
If strFinalSlash = 0 Then
GetDirectoryName = strFilePath
Else
GetDirectoryName = Left(strFilePath, strFinalSlash)
End If
End Function