mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fixed: Moved out nib2cib functions to correct scope so they can be accessed by catch
This commit is contained in:
+19
-18
@@ -120,6 +120,25 @@ ConverterConversionException = @"ConverterConversionException";
|
||||
var temporaryNibFilePath = "",
|
||||
temporaryPlistFilePath = "";
|
||||
|
||||
|
||||
function isReadable(p) {
|
||||
try {
|
||||
fs.accessSync(p, fs.constants.R_OK);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isWritable(p) {
|
||||
try {
|
||||
fs.accessSync(p, fs.constants.W_OK);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'nib2cib-'));
|
||||
@@ -169,24 +188,6 @@ ConverterConversionException = @"ConverterConversionException";
|
||||
p.stderr.close();
|
||||
} */
|
||||
|
||||
function isReadable(p) {
|
||||
try {
|
||||
fs.accessSync(p, fs.constants.R_OK);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isWritable(p) {
|
||||
try {
|
||||
fs.accessSync(p, fs.constants.W_OK);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isReadable(temporaryPlistFilePath))
|
||||
[CPException raise:ConverterConversionException reason:@"Unable to convert nib file."];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user