const { BagItProfile } = require('../bagit/bagit_profile');
const { Constants } = require('../core/constants');
const { Context } = require('../core/context');
const { InternalSetting } = require('../core/internal_setting');
const path = require('path');
const { TestUtil } = require('../core/test_util');
function run() {
return loadBuiltInProfiles();
}
function loadBuiltInProfiles() {
let profile = BagItProfile.find(Constants.BUILTIN_PROFILE_IDS['aptrust'])
if (!profile) {
let jsonFile = path.join(__dirname, '..', 'profiles', 'aptrust_2.2.json');
Context.logger.info(`Installing profile ${name} from ${jsonFile}`);
profile = BagItProfile.load(jsonFile);
profile.isBuiltIn = true;
profile.userCanDelete = false;
profile.save();
} else {
Context.logger.info(`APTrust BagIt profile is already installed`);
}
return true
}
module.exports.run = run;