This repository has been archived by the owner on Apr 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add interactive to deploy-contract to determine the exact contr…
…act (#172) * feat: add interactive to deploy-contract to determine the exact contract * fix: ready for deprecating compileAndDeploy
- Loading branch information
Showing
6 changed files
with
118 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Read one line from stdin and return it | ||
* @param {String} question question to user by stdout | ||
* @returns {Promise} Promise object to returns the value read from stdin | ||
*/ | ||
module.exports = async function(question) { | ||
if (question) { | ||
process.stdout.write(question); | ||
} | ||
|
||
return new Promise(function(resolve) { | ||
// process.stdin.once('data', function(data) { | ||
// resolve(data.toString().trim()); | ||
// }); | ||
process.stdin.setEncoding('utf8'); | ||
|
||
process.stdin.on('data', chunk => { | ||
// Use a loop to make sure we read all available data. | ||
resolve(chunk); | ||
}); | ||
|
||
process.stdin.on('end', () => { | ||
console.log('There will be no more data.'); | ||
process.stdout.write('end'); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters