@@ -19,6 +19,7 @@ import {
1919 SettingsFileIOSParamsInterface ,
2020 SettingsFileIOSInterface ,
2121 SettingsFileAndroidInterface ,
22+ SettingsFileInterface ,
2223} from "./types" ;
2324
2425// Builds for android :
@@ -34,7 +35,7 @@ function buildAndroid(
3435 const OS = osDetection ( ) ;
3536
3637 if ( ! newValues ) {
37- console . log ( logLine ) ;
38+ logLine ( ) ;
3839 return resolve ( ) ;
3940 }
4041
@@ -49,8 +50,11 @@ function buildAndroid(
4950 ) ;
5051 }
5152
52- console . log ( logLine ) ;
53- beautyLog ( "BUILDING " + newValues . buildName + "..." , "info" ) ;
53+ logLine ( ) ;
54+ beautyLog ( "building " + newValues . buildName , "info" , {
55+ boldedTxt : newValues . buildName ,
56+ loadingLog : true ,
57+ } ) ;
5458
5559 // Set variable :
5660 try {
@@ -75,7 +79,9 @@ function buildAndroid(
7579 }
7680
7781 if ( stdout . includes ( "BUILD SUCCESSFUL" ) ) {
78- beautyLog ( newValues . buildName + " FINISHED" , "success" ) ;
82+ beautyLog ( newValues . buildName + " finished" , "success" , {
83+ boldedTxt : newValues . buildName ,
84+ } ) ;
7985
8086 const newPath = path . join (
8187 "." ,
@@ -123,7 +129,7 @@ function buildIOS(
123129 const iosBuildPath = `/ios/${ ARCHIVE_NAME } .xcarchive` ;
124130 const { value : newValues , done } = iosValueGen . next ( ) ;
125131 if ( ! newValues ) {
126- console . log ( logLine ) ;
132+ logLine ( ) ;
127133 return resolve ( ) ;
128134 }
129135
@@ -138,8 +144,11 @@ function buildIOS(
138144 ) ;
139145 }
140146
141- console . log ( logLine ) ;
142- beautyLog ( "BUILDING " + newValues . buildName + "..." , "info" ) ;
147+ logLine ( ) ;
148+ beautyLog ( "building " + newValues . buildName , "info" , {
149+ boldedTxt : newValues . buildName ,
150+ loadingLog : true ,
151+ } ) ;
143152
144153 // Set variable :
145154 try {
@@ -161,7 +170,9 @@ function buildIOS(
161170 }
162171
163172 if ( stdout . includes ( "ARCHIVE SUCCEEDED" ) ) {
164- beautyLog ( newValues . buildName + " FINISHED" , "success" ) ;
173+ beautyLog ( newValues . buildName + " finished" , "success" , {
174+ boldedTxt : newValues . buildName ,
175+ } ) ;
165176 const newPath = path . join (
166177 "." ,
167178 `/builds/ios/${ newValues . buildName } .xcarchive`
@@ -191,7 +202,7 @@ function buildIOS(
191202// Main :
192203export default function main (
193204 platform : PlatformInterface ,
194- settingFilePath : string
205+ settingFilePath : string | SettingsFileInterface
195206) : Promise < any > {
196207 packageInfoLog ( ) ;
197208
@@ -200,11 +211,15 @@ export default function main(
200211 beautyErrorLog ( "invalid setting file address!" ) ;
201212 reject ( new Error ( "invalid setting file address!" ) ) ;
202213 }
203- const parsedSettingFile = initializeSettingFile (
204- platform ,
205- settingFilePath ,
206- reject
207- ) ! ;
214+
215+ let parsedSettingFile : SettingsFileInterface ;
216+ if ( typeof settingFilePath === "string" )
217+ parsedSettingFile = initializeSettingFile (
218+ platform ,
219+ settingFilePath ,
220+ reject
221+ ) ! ;
222+ else parsedSettingFile = settingFilePath ;
208223
209224 const [ androidValueGen , iosValueGen ] = settingFileParameters (
210225 platform ,
@@ -214,7 +229,9 @@ export default function main(
214229
215230 switch ( platform ) {
216231 case "android" :
217- fs . mkdirSync ( buildPathResolver ( "android" ) , { recursive : true } ) ;
232+ fs . mkdirSync ( buildPathResolver ( "android" ) , {
233+ recursive : true ,
234+ } ) ;
218235 buildAndroid (
219236 androidValueGen ! ,
220237 buildObjectResolver ( parsedSettingFile , "android" ) ,
@@ -227,7 +244,9 @@ export default function main(
227244 beautyErrorLog ( "ios need mac operating system!" ) ;
228245 return reject ( new Error ( "ios need mac operating system!" ) ) ;
229246 }
230- fs . mkdirSync ( buildPathResolver ( "ios" ) , { recursive : true } ) ;
247+ fs . mkdirSync ( buildPathResolver ( "ios" ) , {
248+ recursive : true ,
249+ } ) ;
231250 buildIOS (
232251 iosValueGen ! ,
233252 buildObjectResolver (
@@ -239,12 +258,16 @@ export default function main(
239258 ) ;
240259 break ;
241260 case "both" :
242- fs . mkdirSync ( buildPathResolver ( "android" ) , { recursive : true } ) ;
261+ fs . mkdirSync ( buildPathResolver ( "android" ) , {
262+ recursive : true ,
263+ } ) ;
243264 buildAndroid (
244265 androidValueGen ! ,
245266 buildObjectResolver ( parsedSettingFile , "android" ) ,
246267 ( ) => {
247- fs . mkdirSync ( buildPathResolver ( "ios" ) , { recursive : true } ) ;
268+ fs . mkdirSync ( buildPathResolver ( "ios" ) , {
269+ recursive : true ,
270+ } ) ;
248271 buildIOS (
249272 iosValueGen ! ,
250273 buildObjectResolver (
0 commit comments