From f4c8c2eb777e0db6380bf7373ca6d3016316e30e Mon Sep 17 00:00:00 2001 From: Mykola Date: Wed, 26 Feb 2020 16:10:15 -0800 Subject: [PATCH] Use task in pipeline --- azure-pipelines.yml | 24 ++++++++++++++++-------- script/commit.sh | 1 - script/erc20_to_checksum.ts | 4 ++-- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3df2b3ae7..efef3fbea 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,11 +20,14 @@ steps: inputs: versionSpec: '12.x' displayName: Install Node.js - - - script: | - sudo npm install -g typescript - sudo npm install -g ts-node + + - task: Bash@3 displayName: Install global dependency + inputs: + targetType: inline + script: | + sudo npm install -g typescript + sudo npm install -g ts-node - task: Npm@1 inputs: @@ -36,10 +39,15 @@ steps: # key: 'npm | "$(Agent.OS)" | package-lock.json' # path: $(npm_config_cache) # displayName: Cache npm - - - script: | - git config --global user.email "bot@trustwallet.com" - git config --global user.name "TrustWalletBot" + + - task: Bash@3 + displayName: Set git config + inputs: + targetType: inline + script: | + git config --global user.email "bot@trustwallet.com" + git config --global user.name "TrustWalletBot" + - script: sudo npm run checksum:erc20 workingDirectory: $(Build.SourcesDirectory) diff --git a/script/commit.sh b/script/commit.sh index 2735d3e9e..0dbddeab2 100755 --- a/script/commit.sh +++ b/script/commit.sh @@ -3,7 +3,6 @@ if [[ `git status --porcelain --untracked-files=no` ]]; then git add . git commit -m "Checksum ERC20 addresses [skip ci]" - echo Current branch echo Pushing changes to branch: "$SYSTEM_PULLREQUEST_SOURCEBRANCH" echo Current branch $(git branch) git status diff --git a/script/erc20_to_checksum.ts b/script/erc20_to_checksum.ts index 0198e9f8a..91036fea2 100644 --- a/script/erc20_to_checksum.ts +++ b/script/erc20_to_checksum.ts @@ -12,11 +12,11 @@ ethSidechains.forEach(chain => { const isChecksum = web3.utils.checkAddressChecksum(addr) if (!isChecksum) { - console.log(`Address ${addr} not in checksum`) + console.log(`Renaming non checksum ${addr} ...`) const checksum = web3.utils.toChecksumAddress(addr) const moveToChecksum = `git mv ${addr} ${checksum}-temp && git mv ${checksum}-temp ${checksum}` const renamed = execSync(`cd ${assetsPath} && ${moveToChecksum}`, {encoding: "utf-8"}) - console.log(`Result renaming ${addr} : ${renamed}`) + console.log(` Result renaming ${addr} : ${renamed}`) } }) }); \ No newline at end of file