src/indexOld.js
function setVersionSCXML(machineName, versionKey, model, 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.")
        }
        let modelRoute = getVersionModelRoute(machineName, versionKey);
        fs.writeFileSync(repositoryPath + "/" + modelRoute, model);

        if(withCommit) {
            return _commit(null, [modelRoute],
                "Changed the model.scxml for the " + versionKey + " of the '" + machineName + "' machine");
        }
    }
function setVersionSCXML(machineName, versionKey, model, 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.")
        }
        let modelRoute = getVersionModelRoute(machineName, versionKey);
        fs.writeFileSync(repositoryPath + "/" + modelRoute, model);

        if(withCommit) {
            return _commit(null, [modelRoute],
                "Changed the model.scxml for the " + versionKey + " of the '" + machineName + "' machine");
        }
    }
function setVersionSCXML ( machineName , versionKey , model , 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." ) } let modelRoute = getVersionModelRoute ( machineName , versionKey ) ; fs . writeFileSync ( repositoryPath + "/" + modelRoute , model ) ; if ( withCommit ) { return _commit ( null , [ modelRoute ] , "Changed the model.scxml for the " + versionKey + " of the '" + machineName + "' machine" ) ; } }
Update the version model.scxml file using a String
@method setVersionSCXML
@param {String} model The model
@param {String} machineName The name of the machine
@param {String} versionKey The key of the version
@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 model . scxml file using a String