Use task in pipeline

This commit is contained in:
Mykola 2020-02-26 16:10:15 -08:00
parent e429ad9535
commit f4c8c2eb77
3 changed files with 18 additions and 11 deletions

View File

@ -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)

View File

@ -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

View File

@ -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}`)
}
})
});