src/indexOld.js
function setVersionInfo(machineName, versionKey, info, withCommit, message) {

        let route = getVersionInfoRoute(machineName, versionKey);
        let previousInfo = jsonfile.readFileSync(repositoryPath + "/" + route);
        if(previousInfo.isSealed) {
            throw new Error("Cannot change the version SCXML because the version is sealed.")
        }

        jsonfile.writeFileSync(repositoryPath + "/" + route, info, {spaces: 2});

        if(withCommit) {
            return _commit(null, [route],
                message || "Changed the info for the " + versionKey + " of the '" + machineName + "' machine" );
        }

    }
function setVersionInfo(machineName, versionKey, info, withCommit, message) {

        let route = getVersionInfoRoute(machineName, versionKey);
        let previousInfo = jsonfile.readFileSync(repositoryPath + "/" + route);
        if(previousInfo.isSealed) {
            throw new Error("Cannot change the version SCXML because the version is sealed.")
        }

        jsonfile.writeFileSync(repositoryPath + "/" + route, info, {spaces: 2});

        if(withCommit) {
            return _commit(null, [route],
                message || "Changed the info for the " + versionKey + " of the '" + machineName + "' machine" );
        }

    }
function setVersionInfo ( machineName , versionKey , info , withCommit , message ) { let route = getVersionInfoRoute ( machineName , versionKey ) ; let previousInfo = jsonfile . readFileSync ( repositoryPath + "/" + route ) ; if ( previousInfo . isSealed ) { throw new Error ( "Cannot change the version SCXML because the version is sealed." ) } jsonfile . writeFileSync ( repositoryPath + "/" + route , info , { spaces : 2 } ) ; if ( withCommit ) { return _commit ( null , [ route ] , message || "Changed the info for the " + versionKey + " of the '" + machineName + "' machine" ) ; } }
Update the version info.json file using a JavasScript Object
@method setVersionInfo
@param {String} machineName The name of the machine
@param {String} versionKey The key of the version
@param {Object} info The info Object to save
@param {boolean} withCommit If true commits the changes to the repository
@param {String} message If supplied it is used as the message for the commit
@returns {Promise} If withCommit is true, the function returns a Promise
Update the version info . json file using a JavasScript Object