//node.jsnode
const execFile = require('child_process').execFile; const child = execFile('bash', ['./test.sh'], (error, stdout, stderr) => { console.log(`stdout: ${stdout}`); console.log(`stderr: ${stderr}`);w if (error !== null) { console.log(`exec error: ${error}`); } }); child.stdout.on('data', function (data) { console.log('<=====' + data); console.log('=====>'); child.stdin.write(new Buffer('yfemail@163.com\n')) })
//shgit
#!/bin/bash echo "Hello World !" cd /Users/yfan/Desktop/AutoOnlineTest/fastlane/metadata/en-US pwd #需求 輸入 appleid,pswd及提交信息()自動發佈app。 #1. fastlane init 初始化 #2. cert 證書 #3. sign 簽名 #4. snapshot 截圖 #5. gym 打包 #6. deliver 上傳 #修改元數據 (將 ‘美麗天使’換成‘123’) sed -i "" "s/美麗天使/123/g" keywords.txt #添加元數據 echo "安米關鍵字" >> keywords.txt echo "==新的描述" > description.txt echo "http://tuitui.pro.cn/" > support_url.txt echo "==新的描述" > description.txt cat keywords.txt cd /Users/yfan/Desktop/AutoOnlineTest/fastlane/metadata echo "2016 tuitui.pro.cn" > copyright.txt
nodejs 編寫命令行腳本github