mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-21 19:19:11 +01:00
(stable) Promote 2021 Week 13
This commit is contained in:
commit
7af9846f99
2 changed files with 24 additions and 2 deletions
|
@ -269,7 +269,29 @@ final class Filesystem extends Phobject {
|
||||||
self::assertReadable($from);
|
self::assertReadable($from);
|
||||||
|
|
||||||
if (phutil_is_windows()) {
|
if (phutil_is_windows()) {
|
||||||
execx('copy /Y %s %s', $from, $to);
|
$trap = new PhutilErrorTrap();
|
||||||
|
$ok = @copy($from, $to);
|
||||||
|
$err = $trap->getErrorsAsString();
|
||||||
|
$trap->destroy();
|
||||||
|
|
||||||
|
if (!$ok) {
|
||||||
|
if (strlen($err)) {
|
||||||
|
throw new FilesystemException(
|
||||||
|
$to,
|
||||||
|
pht(
|
||||||
|
'Failed to copy file from "%s" to "%s": %s',
|
||||||
|
$from,
|
||||||
|
$to,
|
||||||
|
$err));
|
||||||
|
} else {
|
||||||
|
throw new FilesystemException(
|
||||||
|
$to,
|
||||||
|
pht(
|
||||||
|
'Failed to copy file from "%s" to "%s".',
|
||||||
|
$from,
|
||||||
|
$to));
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
execx('cp -p %s %s', $from, $to);
|
execx('cp -p %s %s', $from, $to);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ final class ArcanistPasteWorkflow
|
||||||
Share and grab text using the Paste application. To create a paste, use the
|
Share and grab text using the Paste application. To create a paste, use the
|
||||||
"--input" flag or provide the text on stdin:
|
"--input" flag or provide the text on stdin:
|
||||||
|
|
||||||
$ cat list_of_ducks.txt | arc paste
|
$ cat list_of_ducks.txt | arc paste --
|
||||||
$ arc paste --input list_of_ducks.txt
|
$ arc paste --input list_of_ducks.txt
|
||||||
|
|
||||||
To retrieve a paste, specify the paste ID:
|
To retrieve a paste, specify the paste ID:
|
||||||
|
|
Loading…
Add table
Reference in a new issue