Skip to content

Commit

Permalink
chore: debug composer diff
Browse files Browse the repository at this point in the history
  • Loading branch information
Leksat committed Apr 21, 2022
1 parent e7044ae commit 1315881
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/lock-file-changes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

const LOCKFILE = 'composer.lock';

function getFileContents($path) {
$originalPath = $path;

if (empty($path)) {
$path = LOCKFILE;
}

if (filter_var($path, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED) || file_exists($path)) {
var_dump('file_get_contents($path)');
var_dump(file_get_contents($path));
}

if (FALSE === strpos($originalPath, ':')) {
$path .= ':' . LOCKFILE;
}

$output = [];
@exec(sprintf('git show %s 2>&1', escapeshellarg($path)), $output, $exit);

if (0 !== $exit) {
var_dump('ERROR');
var_dump([
'$exit' => $exit,
'$output' => $output,
'$path' => $path,
'escapeshellarg($path)' => escapeshellarg($path),
"sprintf('git show %s 2>&1', escapeshellarg($path))" => sprintf('git show %s 2>&1', escapeshellarg($path)),
]);
}

var_dump('implode("\n", $output)');
var_dump(implode("\n", $output));
}

getFileContents('ad66625dce6fd04da4b628f870a7230cce53fd10:apps/silverback-drupal/composer.lock');
2 changes: 1 addition & 1 deletion .github/workflows/lock-file-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: git show ad66625dce6fd04da4b628f870a7230cce53fd10:apps/silverback-drupal/composer.lock

- name: debug 2
run: git show ad66625dce6fd04da4b628f870a7230cce53fd10
run: php .github/workflows/lock-file-changes.php

# composer.lock
- name: Generate composer diff
Expand Down

0 comments on commit 1315881

Please sign in to comment.