Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
spyOn(xmlHelpers, 'parseElementtreeSync').and.callFake(function(path) {
if (/WMAppManifest.xml$/.exec(path)) {
return manifestXml = new et.ElementTree(et.XML(MANIFEST_XML));
} else if (/csproj$/.exec(path)) {
return projXml = new et.ElementTree(et.XML(PROJ_XML));
} else if (/MainPage.xaml$/.exec(path)) {
return mainPageXamlXml = new et.ElementTree(et.XML(MAINPAGEXAML_XML));
} else if (/xaml$/.exec(path)) {
return new et.ElementTree(et.XML(XAML_XML));
} else {
throw new CordovaError('Unexpected parseElementtreeSync: ' + path);
}
});
});
spyOn(xmlHelpers, 'parseElementtreeSync').and.callFake(function(path) {
if (/strings/.exec(path)) {
return stringsRoot = new et.ElementTree(et.XML(STRINGS_XML));
} else if (/AndroidManifest/.exec(path)) {
return manifestRoot = new et.ElementTree(et.XML(MANIFEST_XML));
} else {
throw new CordovaError('Unexpected parseElementtreeSync: ' + path);
}
});
getOrientation = spyOn(p.helper, 'getOrientation');
spyOn(xmlHelpers, 'parseElementtreeSync').andCallFake(function(path) {
if (/WMAppManifest.xml$/.exec(path)) {
return manifestXml = new et.ElementTree(et.XML(''));
} else if (/csproj$/.exec(path)) {
return projXml = new et.ElementTree(et.XML(''));
} else if (/xaml$/.exec(path)) {
return new et.ElementTree(et.XML(''));
} else {
throw new CordovaError('Unexpected parseElementtreeSync: ' + path);
}
});
});
spyOn(xmlHelpers, 'parseElementtreeSync').andCallFake(function(path) {
if (/WMAppManifest.xml$/.exec(path)) {
return manifestXml = new et.ElementTree(et.XML(''));
} else if (/csproj$/.exec(path)) {
return projXml = new et.ElementTree(et.XML(''));
} else if (/xaml$/.exec(path)) {
return new et.ElementTree(et.XML(''));
} else {
throw new CordovaError('Unexpected parseElementtreeSync: ' + path);
}
});
});
(function(require, console) {
var projectName = 'SpiderOak',
fs = require('fs'),
path = require('path'),
et = require('elementtree'),
shell = require('shelljs'),
projectRootDir = path.resolve(__dirname, '..', '..', '..'),
configPath = path.join(projectRootDir, 'www', 'config.xml');
var doc = new et.ElementTree(et.XML(fs.readFileSync(configPath, 'utf-8')));
doc.getroot().attrib.version =
shell.exec('git describe --tags', {silent:true}).output.trim();
fs.writeFileSync(configPath, doc.write({indent: 4}), 'utf-8');
})(require, console);