mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Remove $native.move()
This commit is contained in:
@@ -26,7 +26,7 @@ namespace v8_extensions {
|
||||
const char* methodNames[] = {
|
||||
"absolute",
|
||||
"remove", "writeToPasteboard", "readFromPasteboard", "quit", "watchPath", "unwatchPath",
|
||||
"getWatchedPaths", "unwatchAllPaths", "move", "moveToTrash", "reload",
|
||||
"getWatchedPaths", "unwatchAllPaths", "moveToTrash", "reload",
|
||||
"md5ForPath", "getPlatform", "setWindowState", "getWindowState", "isMisspelled",
|
||||
"getCorrectionsForMisspelling"
|
||||
};
|
||||
@@ -154,20 +154,6 @@ namespace v8_extensions {
|
||||
[pathWatcher unwatchAllPaths];
|
||||
return true;
|
||||
}
|
||||
else if (name == "move") {
|
||||
NSString *sourcePath = stringFromCefV8Value(arguments[0]);
|
||||
NSString *targetPath = stringFromCefV8Value(arguments[1]);
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
|
||||
NSError *error = nil;
|
||||
[fm moveItemAtPath:sourcePath toPath:targetPath error:&error];
|
||||
|
||||
if (error) {
|
||||
exception = [[error localizedDescription] UTF8String];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (name == "moveToTrash") {
|
||||
NSString *sourcePath = stringFromCefV8Value(arguments[0]);
|
||||
bool success = [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation
|
||||
|
||||
@@ -81,7 +81,7 @@ module.exports =
|
||||
paths
|
||||
|
||||
move: (source, target) ->
|
||||
$native.move(source, target)
|
||||
nodeFs.renameSync(source, target)
|
||||
|
||||
# Remove a file at the given path. Throws an error if path is not a
|
||||
# file or a symbolic link to a file.
|
||||
|
||||
Reference in New Issue
Block a user