File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34408,19 +34408,17 @@ const previewUpdater = async () => {
3440834408 // Read file
3440934409 const content = (0, filesystem_1.readFile)(config, config.path.readme);
3441034410 const preview = (0, preview_1.setPreview)(content, config);
34411- if (content !== preview) {
34412- // Checkout branch
34413- const branchExists = await repo.branchExists();
34414- (0, core_1.info)(`Checkout ${branchExists ? 'existing' : 'new'} branch named "${repo.branchName()}"`);
34415- await repo.checkoutBranch(!branchExists);
34416- // Write a file
34417- (0, core_1.info)(`Update readme in "${config.path.readme}" file`);
34418- (0, filesystem_1.writeFile)(config, config.path.readme, preview);
34419- }
34420- else {
34411+ if (content === preview) {
3442134412 (0, core_1.info)(`File "${config.path.readme}" is up to date`);
3442234413 return;
3442334414 }
34415+ // Checkout branch
34416+ const branchExists = await repo.branchExists();
34417+ (0, core_1.info)(`Checkout ${branchExists ? 'existing' : 'new'} branch named "${repo.branchName()}"`);
34418+ await repo.checkoutBranch(!branchExists);
34419+ // Write a file
34420+ (0, core_1.info)(`Update readme in "${config.path.readme}" file`);
34421+ (0, filesystem_1.writeFile)(config, config.path.readme, preview);
3442434422 // Stage and commit changes
3442534423 await repo.stage();
3442634424 await repo.commit();
Original file line number Diff line number Diff line change @@ -45,21 +45,21 @@ const previewUpdater = async () => {
4545 const content = readFile ( config , config . path . readme )
4646 const preview = setPreview ( content , config )
4747
48- if ( content !== preview ) {
49- // Checkout branch
50- const branchExists = await repo . branchExists ( )
51- info ( `Checkout ${ branchExists ? 'existing' : 'new' } branch named "${ repo . branchName ( ) } "` )
52- await repo . checkoutBranch ( ! branchExists )
53-
54- // Write a file
55- info ( `Update readme in "${ config . path . readme } " file` )
56- writeFile ( config , config . path . readme , preview )
57- } else {
48+ if ( content === preview ) {
5849 info ( `File "${ config . path . readme } " is up to date` )
5950
6051 return
6152 }
6253
54+ // Checkout branch
55+ const branchExists = await repo . branchExists ( )
56+ info ( `Checkout ${ branchExists ? 'existing' : 'new' } branch named "${ repo . branchName ( ) } "` )
57+ await repo . checkoutBranch ( ! branchExists )
58+
59+ // Write a file
60+ info ( `Update readme in "${ config . path . readme } " file` )
61+ writeFile ( config , config . path . readme , preview )
62+
6363 // Stage and commit changes
6464 await repo . stage ( )
6565 await repo . commit ( )
You can’t perform that action at this time.
0 commit comments