diff --git a/eo-version.txt b/eo-version.txt index 5d7663b..a560e4b 100644 --- a/eo-version.txt +++ b/eo-version.txt @@ -1 +1 @@ -0.35.1 \ No newline at end of file +0.35.2 \ No newline at end of file diff --git a/home-hash.txt b/home-hash.txt new file mode 100644 index 0000000..cb55d68 --- /dev/null +++ b/home-hash.txt @@ -0,0 +1 @@ +130afdd1456a0cbafd52aee8d7bc612e1faac547 \ No newline at end of file diff --git a/src/commands/phi.js b/src/commands/phi.js index 0f755a3..401382f 100644 --- a/src/commands/phi.js +++ b/src/commands/phi.js @@ -24,7 +24,7 @@ const rel = require('relative'); const path = require('path'); -const {gte} = require('../demand') +const {gte} = require('../demand'); const {mvnw, flags} = require('../mvnw'); /** diff --git a/src/commands/unphi.js b/src/commands/unphi.js index 0bde0ba..294bb47 100644 --- a/src/commands/unphi.js +++ b/src/commands/unphi.js @@ -25,7 +25,7 @@ const rel = require('relative'); const path = require('path'); const {mvnw, flags} = require('../mvnw'); -const {gte} = require('../demand') +const {gte} = require('../demand'); /** * Command to convert .PHI files into .XMIR files. diff --git a/src/demand.js b/src/demand.js index 7fe4055..40365d4 100644 --- a/src/demand.js +++ b/src/demand.js @@ -26,10 +26,17 @@ const semver = require('semver'); /** * Only if provided version is the required one or younger. + * + * @param {String} subject - What is being checked + * @param {String} current - Current version + * @param {String} min - Minimal expected version */ module.exports.gte = function(subject, current, min) { if (semver.lt(current, min)) { - console.error('%s is required to have version %s or higher, while you use %s', subject, min, current); + console.error( + '%s is required to have version %s or higher, while you use %s', + subject, min, current + ); process.exit(1); } -} +}; diff --git a/src/eoc.js b/src/eoc.js index a3e1018..2038b42 100755 --- a/src/eoc.js +++ b/src/eoc.js @@ -56,6 +56,8 @@ if (process.argv.includes('--latest')) { console.debug('EO parser ' + parser + '; use the --latest flag if you need a freshier one'); } +const hash = fs.readFileSync(path.join(__dirname, '../home-hash.txt'), 'utf8'); + const version = require('./version'); program .name('eoc') @@ -68,7 +70,7 @@ program program .option('-s, --sources ', 'Directory with .EO sources', '.') .option('-t, --target ', 'Directory with all generated files', '.eoc') - .option('--hash ', 'Hash in objectionary/home to compile against', parser) + .option('--hash ', 'Hash in objectionary/home to compile against', hash) .option('--parser ', 'Set the version of EO parser to use', parser) .option('--latest', 'Use the latest parser version from Maven Central') .option('--alone', 'Just run a single command without dependencies') diff --git a/test/commands/test_dataize.js b/test/commands/test_dataize.js index ec6a857..338c973 100644 --- a/test/commands/test_dataize.js +++ b/test/commands/test_dataize.js @@ -30,6 +30,7 @@ const {runSync, parserVersion, homeHash} = require('../helpers'); const versions = new Map([ [parserVersion, homeHash], + ['0.35.1', '130afdd1456a0cbafd52aee8d7bc612e1faac547'], ['0.34.1', '1d605bd872f27494551e9dd2341b9413d0d96d89'], ]); versions.forEach(function(hash, version) { diff --git a/test/commands/test_link.js b/test/commands/test_link.js index 0ca9d6d..44a0152 100644 --- a/test/commands/test_link.js +++ b/test/commands/test_link.js @@ -38,7 +38,7 @@ describe('link', function() { '+package foo.bar', '+alias org.eolang.io.stdout', '', - '# sample object' + '# sample object', '[args] > link', ' stdout "Hello, world!" > @', ].join('\n')