import os from 'os' ; import execa from 'execa' ; export async function getBuildNumber ( ) { if ( /^win/ . test ( os . platform ( ) ) ) { const log = await execa ( 'git' , [ 'log' , '--format="%h"' ] ) ; return log . stdout . split ( '\n' ) . length ; } const wc = await execa . command ( 'git log --format="%h" | wc -l' , { shell : true , } ) ; return parseFloat ( wc . stdout . trim ( ) ) ; }