Skip to content

Commit

Permalink
fix last commmand was not running and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
slavaGanzin committed Oct 30, 2024
1 parent 6020ab6 commit e5dfab0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Check if Release Exists
id: check_release
run: |
gh release view 1.0.6 || echo "Release does not exist"
gh release view 1.0.7 || echo "Release does not exist"
- name: Create or Update Release
id: create_update_release
Expand All @@ -79,16 +79,16 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 1.0.6
release_name: 1.0.6
tag_name: 1.0.7
release_name: 1.0.7
body: Fixed ctrl-c handling when it's run from bash script
draft: false
prerelease: false

- name: Update Release Archives
if: steps.check_release.outputs.exists == 'true'
run: |
gh release upload 1.0.6 archives/* --clobber
gh release upload 1.0.7 archives/* --clobber
- name: Download Artifact
uses: actions/download-artifact@v4
Expand All @@ -97,14 +97,14 @@ jobs:
run: |
mkdir -p archives
tree
tar -czvf archives/await-1.0.6-aarch64-x86_64-apple-darwin.tar.gz -C await-macos-latest .
tar -czvf archives/await-1.0.6-x86_64-unknown-linux-gnu.tar.gz -C await-ubuntu-latest .
tar -czvf archives/await-1.0.7-aarch64-x86_64-apple-darwin.tar.gz -C await-macos-latest .
tar -czvf archives/await-1.0.7-x86_64-unknown-linux-gnu.tar.gz -C await-ubuntu-latest .
tree
- name: Upload Release Artifacts
uses: softprops/action-gh-release@v1
with:
files: archives/*
tag_name: 1.0.6
tag_name: 1.0.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 6 additions & 3 deletions await.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void parse_args(int argc, char *argv[]) {
case 'S': args.service = optarg; break;
case 'i': args.interval = atoi(optarg); break;
case 'd': args.daemonize = 1; break;
case 'v': printf("1.0.6\n"); exit(0); break;
case 'v': printf("1.0.7\n"); exit(0); break;
case 'h': case '?': help(); break;
case 1:
if (strcmp(long_options[option_index].name, "autocomplete-fish") == 0) {
Expand Down Expand Up @@ -502,18 +502,20 @@ int main(int argc, char *argv[]) {

FILE *fp;

for(int i = 0; i < args.nCommands; i++) {
for(int i = 0; i <= args.nCommands; i++) {
c[i].status = -1;
pthread_create(&c[i].thread, NULL, shell, &c[i]);
}

int not_done;

while (1) {
not_done = 0;
for(int i = 0; i <= args.nCommands; i++) {
if (!args.silent) {
int color = c[i].status == -1 ? 7 : c[i].status == args.expectedStatus ? 2 : 1;
fprintf(stderr, "\033[%dB\r\033[K\033[0;3%dm%s\033[0m %s\033[%dA\r", i, color, spinner[c[i].spinner], c[i].command, i);
int line = i;
fprintf(stderr, "\033[%dB\r\033[K\033[0;3%dm%s\033[0m %s\033[%dA\r", line, color, spinner[c[i].spinner], c[i].command, line);
}
if (args.stdout && c[i].out) {
printf("%s", c[i].out);
Expand Down Expand Up @@ -549,6 +551,7 @@ int main(int argc, char *argv[]) {
}
if (exec.spinner == 0) {
fprintf(stderr, "\033[%dB\r", args.nCommands+1);
fprintf(stderr, "");
return 0;
}
}
Expand Down

0 comments on commit e5dfab0

Please sign in to comment.