lib/archivist/migration.js
function getAvailableMigrations(vaultName, cb) {
	var path = configuration.getMigrationsPath(vaultName);

	fs.readdir(path, function (error, files) {
		if (error) {
			if (error.code === 'ENOENT') {
				logger.warning('No migration folder found for vault', vaultName, '(skipping).');
				return cb(null, []);
			}

			return cb(error);
		}

		var result = [];
		for (var i = 0; i < files.length; i++) {
			var file = files[i];
			var ext = extname(file);

			if (mage.isCodeFileExtension(ext)) {
				result.push(basename(file, ext));
			}
		}

		cb(null, result);
	});
}
function getAvailableMigrations(vaultName, cb) {
	var path = configuration.getMigrationsPath(vaultName);

	fs.readdir(path, function (error, files) {
		if (error) {
			if (error.code === 'ENOENT') {
				logger.warning('No migration folder found for vault', vaultName, '(skipping).');
				return cb(null, []);
			}

			return cb(error);
		}

		var result = [];
		for (var i = 0; i < files.length; i++) {
			var file = files[i];
			var ext = extname(file);

			if (mage.isCodeFileExtension(ext)) {
				result.push(basename(file, ext));
			}
		}

		cb(null, result);
	});
}
function getAvailableMigrations ( vaultName , cb ) { var path = configuration . getMigrationsPath ( vaultName ) ; fs . readdir ( path , function ( error , files ) { if ( error ) { if ( error . code === 'ENOENT' ) { logger . warning ( 'No migration folder found for vault' , vaultName , '(skipping).' ) ; return cb ( null , [ ] ) ; } return cb ( error ) ; } var result = [ ] ; for ( var i = 0 ; i < files . length ; i ++ ) { var file = files [ i ] ; var ext = extname ( file ) ; if ( mage . isCodeFileExtension ( ext ) ) { result . push ( basename ( file , ext ) ) ; } } cb ( null , result ) ; } ) ; }
Scans the hard disk for available migration files for this vault and returns the version names.

@param {string} vaultName  The vault name for which to migrate.
@param {Function} cb       Callback that receives the found version numbers that can be migrated to or from.
Scans the hard disk for available migration files for this vault and returns the version names .