Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function applyUAPVersionToProject(projectFilePath, uapVersionInfo) {
// No uapVersionInfo means that there is no UAP SDKs installed and there is nothing to do for us
if (!uapVersionInfo) return;
var fileContents = fs.readFileSync(projectFilePath).toString().trim();
var xml = et.parse(fileContents);
var tpv = xml.find('./PropertyGroup/TargetPlatformVersion');
var tpmv = xml.find('./PropertyGroup/TargetPlatformMinVersion');
tpv.text = uapVersionInfo.targetUAPVersion.toString();
tpmv.text = uapVersionInfo.minUAPVersion.toString();
fs.writeFileSync(projectFilePath, xml.write({ indent: 4 }), {});
}
function applyUAPVersionToProject(projectFilePath, uapVersionInfo) {
// No uapVersionInfo means that there is no UAP SDKs installed and there is nothing to do for us
if (!uapVersionInfo) return;
var fileContents = fs.readFileSync(projectFilePath).toString().trim();
var xml = et.parse(fileContents);
var tpv = xml.find('./PropertyGroup/TargetPlatformVersion');
var tpmv = xml.find('./PropertyGroup/TargetPlatformMinVersion');
tpv.text = uapVersionInfo.targetUAPVersion.toString();
tpmv.text = uapVersionInfo.minUAPVersion.toString();
fs.writeFileSync(projectFilePath, xml.write({ indent: 4 }), {});
}
function applyUAPVersionToProject(projectFilePath, uapVersionInfo) {
// No uapVersionInfo means that there is no UAP SDKs installed and there is nothing to do for us
if (!uapVersionInfo) return;
var fileContents = fs.readFileSync(projectFilePath).toString().trim();
var xml = et.parse(fileContents);
var tpv = xml.find('./PropertyGroup/TargetPlatformVersion');
var tpmv = xml.find('./PropertyGroup/TargetPlatformMinVersion');
tpv.text = uapVersionInfo.targetUAPVersion.toString();
tpmv.text = uapVersionInfo.minUAPVersion.toString();
fs.writeFileSync(projectFilePath, xml.write({ indent: 4 }), {});
}
function applyUAPVersionToProject(projectFilePath, uapVersionInfo) {
// No uapVersionInfo means that there is no UAP SDKs installed and there is nothing to do for us
if (!uapVersionInfo) return;
var fileContents = fs.readFileSync(projectFilePath).toString().trim();
var xml = et.parse(fileContents);
var tpv = xml.find('./PropertyGroup/TargetPlatformVersion');
var tpmv = xml.find('./PropertyGroup/TargetPlatformMinVersion');
tpv.text = uapVersionInfo.targetUAPVersion.toString();
tpmv.text = uapVersionInfo.minUAPVersion.toString();
fs.writeFileSync(projectFilePath, xml.write({ indent: 4 }), {});
}
ModularInput.runScript(exports, args, ew, inStream, function(err, scriptStatus) {
test.ok(!err);
var expected = utils.readFile(__filename, "../data/stream_with_two_events.xml");
var found = ew._out._read() + "";
test.ok(testUtils.XMLCompare(ET.parse(expected).getroot(), ET.parse(found).getroot()));
test.strictEqual(0, scriptStatus);
test.done();
});
inStream.emit("data", new Buffer(inputConfiguration));