salahhusa9 / laravel-updater

Laravel Updater is a simple yet powerful package for updater your Laravel applications. It makes it easy to upgrade your application to the latest version with just one command.
https://salahhusa9.com/laravel-updater
MIT License
175 stars 18 forks source link

[Bug]: Errors while trying to update #16

Closed hipoagencia closed 10 months ago

hipoagencia commented 10 months ago

What happened?

I cant make php artisan updater:update work

How to reproduce the bug

Just use the command

Package Version

0.1

PHP Version

8.2

Laravel Version

9

Which operating systems does with happen with?

Linux

Notes

Hello.. This is the error! Thanks

 fatal: No names found, cannot describe anything.

  at vendor/salahhusa9/laravel-updater/src/Helpers/Git.php:58
     54▕     {
     55▕         $process = Process::run(self::gitPath().' describe --tags --abbrev=0');
     56▕
     57▕         if ($process->failed()) {
  ➜  58▕             throw new \Exception($process->errorOutput());
     59▕         }
     60▕
     61▕         return trim($process->output());
     62▕     }

      +16 vendor frames

  17  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
salahhusa9 commented 10 months ago

The package does support Laravel 9, but how do you install it in laravel 9? and try run git describe --tags --abbrev=0 and tell me output

salahhusa9 commented 10 months ago

if you run this git describe --tags --abbrev=0 you get the same message because you don't create any release or tag

hipoagencia commented 10 months ago

The package does support Laravel 9, but how do you install it in laravel 9? and try run git describe --tags --abbrev=0 and tell me output

Sorry! Its 10.29.0 version.

hipoagencia commented 10 months ago

if you run this git describe --tags --abbrev=0 you get the same message because you don't create any release or tag

I didnt get what i have to do. I never done anything like that. Maybe my GITHUB_REPOSITORY is wrong?

hipoagencia commented 10 months ago

if you run this git describe --tags --abbrev=0 you get the same message because you don't create any release or tag

Or maybe i didnt set the right permission in Github Token

salahhusa9 commented 10 months ago

you create a release of your project?

salahhusa9 commented 10 months ago

this ex of env:

GITHUB_TOKEN=ghp_1234567890
GITHUB_USERNAME=salahhusa9
GITHUB_REPOSITORY=laravel-updater
hipoagencia commented 10 months ago

you create a release of your project?

Oh.. i never created any project using release. They are always private haha. My bad. I will try now

hipoagencia commented 10 months ago

Okay, i think that i'm dumb hahaha. Already created a release and the error persists.

salahhusa9 commented 10 months ago

run git pull and retry

hipoagencia commented 10 months ago

Thanks for your help! Its working for the first time. But when i use the command, i have to stash and merge into a brench.. do you know how to fix that?

hipoagencia commented 10 months ago

This is what happen when i try to run for the second time

` You are not currently on a branch. Please specify which branch you want to merge with. See git-pull(1) for details.

git pull <remote> <branch>

at vendor/salahhusa9/laravel-updater/src/Helpers/Git.php:94 90▕ { 91▕ $process = Process::run(self::gitPath().' pull'); 92▕ 93▕ if ($process->failed()) { ➜ 94▕ throw new \Exception($process->errorOutput()); 95▕ } 96▕ 97▕ return trim($process->output()); 98▕ }

  +19 vendor frames

`

salahhusa9 commented 10 months ago

run git status and get me output

hipoagencia commented 10 months ago

run git status and get me output

` HEAD detached at 1.0.2 Untracked files: (use "git add ..." to include in what will be committed) composer.phar

nothing added to commit but untracked files present (use "git add" to track) `

salahhusa9 commented 10 months ago

as i think the problem is in git not in package, you are now in 1.0.2 it's good but you don't commit this file composer.phar

salahhusa9 commented 10 months ago

go back to main branch and push this file and create new release of put this file in .gitignore and commit

hipoagencia commented 10 months ago

as i think the problem is in git not in package, you are now in 1.0.2 it's good but you don't commit this file composer.phar

Oh okay! I will check what i need to do. Anyway, thanks for your help! The package is just great <3

salahhusa9 commented 10 months ago

as i think the problem is in git not in package, you are now in 1.0.2 it's good but you don't commit this file composer.phar

Oh okay! I will check what i need to do. Anyway, thanks for your help! The package is just great <3

no problem

jhoanborges commented 8 months ago

I'm having the same error:

PS C:\laragon\www\wms> git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   composer.json
        modified:   composer.lock

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\laragon\www\wms>
salahhusa9 commented 8 months ago

@jhoanborges just commit your local change before update