3 namespace App\Console\Commands;
6 use Illuminate\Console\Command;
8 class BeatPatchCommand extends Command
11 * The name and signature of the console command.
15 protected $signature = 'beat:patch {source} {patch} {target}';
18 * The console command description.
22 protected $description = 'Apply BPS patch';
25 * Execute the console command.
29 public function handle()
31 $source = file_get_contents($this->argument('source'));
32 $patch = file_get_contents($this->argument('patch'));
33 $decoder = new Decoder($source);
34 $target = $decoder->applyPatch($patch);
35 file_put_contents($this->argument('target'), $target);