@@ -10,7 +10,6 @@ type Configs = {
1010 type ?: SemVer
1111 skipSemVerFor : Platforms [ ]
1212 skipCodeFor : Platforms [ ]
13- ignoreGitCheck ?: boolean
1413 root : string
1514 pbxprojPath : string
1615 buildGradlePath : string
@@ -192,10 +191,10 @@ class PackageJSONManager {
192191}
193192
194193export class ProjectFilesManager {
195- private readonly configs : Configs
196- private readonly pbx : PBXManager
197- private readonly buildGradle : BuildGradleManager
198- private readonly packageJSON : PackageJSONManager
194+ readonly configs : Configs
195+ readonly pbx : PBXManager
196+ readonly buildGradle : BuildGradleManager
197+ readonly packageJSON : PackageJSONManager
199198
200199 constructor ( configs : Configs ) {
201200 const {
@@ -260,7 +259,19 @@ export class ProjectFilesManager {
260259
261260 }
262261
263- exec ( ) {
262+ run ( ) {
263+ this . dryRun ( )
264+ this . pbx . write ( )
265+ this . buildGradle . write ( )
266+ this . packageJSON . write ( )
267+ }
268+
269+ /**
270+ * Separated for testing
271+ *
272+ * This executes changes but don't actually write anything to fs
273+ */
274+ dryRun ( ) {
264275 const { type, skipSemVerFor, skipCodeFor } = this . configs
265276 const current = this . packageJSON . getVersion ( )
266277 const next = incrementSemVer ( current , type ?? 'minor' )
@@ -277,12 +288,10 @@ export class ProjectFilesManager {
277288 this . syncSemver ( next )
278289 }
279290
280- this . pbx . write ( )
281- this . buildGradle . write ( )
282- this . packageJSON . write ( )
291+ return this ;
283292 }
284293}
285294
286295export const versioner = ( configs : Configs ) => {
287- new ProjectFilesManager ( configs ) . exec ( )
296+ new ProjectFilesManager ( configs ) . run ( )
288297}
0 commit comments