mirror of
https://github.com/demostf/migrate.git
synced 2026-06-03 17:24:10 +02:00
fix name
This commit is contained in:
parent
d7eddee9f7
commit
ac7078291d
1 changed files with 7 additions and 6 deletions
|
|
@ -16,21 +16,22 @@ class Migrate {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function migrateDemo(array $demo): bool {
|
public function migrateDemo(array $demo): bool {
|
||||||
if (!$this->store->exists($demo['name'])) {
|
$name = basename($demo['url']);
|
||||||
throw new \Exception('demo not found: ' . $this->store->generatePath($demo['name']));
|
if (!$this->store->exists($name)) {
|
||||||
|
throw new \Exception('demo not found: ' . $this->store->generatePath($name));
|
||||||
}
|
}
|
||||||
|
|
||||||
$hash = $this->store->hash($demo['name']);
|
$hash = $this->store->hash($name);
|
||||||
|
|
||||||
if ($hash !== $demo['hash']) {
|
if ($hash !== $demo['hash']) {
|
||||||
throw new \Exception('hash mismatch: ' . $this->store->generatePath($demo['name']));
|
throw new \Exception('hash mismatch: ' . $this->store->generatePath($name));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->api->changeDemo(
|
return $this->api->changeDemo(
|
||||||
$demo['id'],
|
$demo['id'],
|
||||||
$this->backend,
|
$this->backend,
|
||||||
$this->store->generatePath($demo['name']),
|
$this->store->generatePath($name),
|
||||||
$this->store->generateUrl($demo['name']),
|
$this->store->generateUrl($name),
|
||||||
$hash,
|
$hash,
|
||||||
$this->key
|
$this->key
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue