mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
28 lines
723 B
JavaScript
Executable File
28 lines
723 B
JavaScript
Executable File
let alfrescoApi = require('@alfresco/js-api');
|
|
let program = require('commander');
|
|
|
|
async function main() {
|
|
|
|
program
|
|
.version('0.1.0')
|
|
.option('--host [type]', 'Remote environment host adf.lab.com ')
|
|
.option('-p, --password [type]', 'password ')
|
|
.option('-u, --username [type]', 'username ')
|
|
.parse(process.argv);
|
|
|
|
try {
|
|
|
|
this.alfrescoJsApi = new alfrescoApi.AlfrescoApiCompatibility({
|
|
provider: 'ECM',
|
|
hostEcm: program.host
|
|
});
|
|
await this.alfrescoJsApi.login(program.username, program.password);
|
|
} catch (e) {
|
|
console.log('Login error environment down or inaccessible');
|
|
process.exit(1);
|
|
}
|
|
|
|
}
|
|
|
|
main();
|