Skip to content

Commit 99130d7

Browse files
committed
updater basics now in
1 parent e58290d commit 99130d7

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
database.sqlite
66
forgetdb.yml
77
.env
8-
*.phar
8+
*.phar
9+
application.backup

Diff for: app/Services/UpdateService.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,18 @@ public function updateTo($update): string
9393
$fileToOverWrite = $this->fileToOverWrite();
9494

9595
if (file_exists($fileToOverWrite)) {
96-
rename($fileToOverWrite, 'bkup-' . $fileToOverWrite);
96+
@rename($fileToOverWrite, $fileToOverWrite . '.backup');
9797
}
9898

99-
file_put_contents($fileToOverWrite, $data);
99+
@file_put_contents($fileToOverWrite, $data);
100100

101-
chmod($fileToOverWrite, 0755);
101+
@chmod($fileToOverWrite, 0755);
102102

103103
if (file_exists($fileToOverWrite)) {
104104
return $fileToOverWrite;
105105
}
106106

107-
rename('bkup-' . $fileToOverWrite, $fileToOverWrite);
107+
@rename($fileToOverWrite . '.backup', $fileToOverWrite);
108108

109109
throw new Exception('Hmm could not download the file, looks like there are some permission issues, you can manually download the update from ' . $fileUrl);
110110
}

Diff for: builds/application

1.37 MB
Binary file not shown.

Diff for: config/app.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
| number MAJOR.MINOR.PATCH when an update happens: https://semver.org.
2525
|
2626
*/
27-
'version' => '0.0.6',
27+
'version' => app('git.version'),
2828

2929
/*
3030
|--------------------------------------------------------------------------

0 commit comments

Comments
 (0)