mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-04 16:12:58 +00:00
Fixed: Moved out nib2cib functions to correct scope so they can be accessed by catch
This commit is contained in:
1 parent
1440c156b2
commit
c9e8b2970b
1 file changed
+19
-18
+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