fix(workflow): truncate path

This commit is contained in:
Maarten van Heusden
2024-11-17 12:04:41 +01:00
parent 3f70e4ef91
commit 377a0fcb98
2 changed files with 10 additions and 8 deletions

View File

@@ -62,22 +62,21 @@ jobs:
with:
args: ${{ matrix.args }}
includeUpdaterJson: false
- name: fix JSON
id: truncate_paths
run: echo "::set-output name=paths::$(echo '${{ steps.build.outputs.artifactPaths }}' | sed 's/^..//' | sed 's/..$//')"
run: echo "paths=$(echo '${{ steps.build.outputs.artifactPaths }}' | sed 's/^..//' | sed 's/..$//')" >> $GITHUB_OUTPUT
- name: upload unix artifacts
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-22.04'
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: ${{ steps.build.outputs.artifactPaths }}
path: ${{ steps.truncate_paths.outputs.paths }}
- name: upload windows artifacts
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: ${{ steps.build.outputs.artifactPaths }}
path: ${{ steps.truncate_paths.outputs.paths }}

View File

@@ -2,7 +2,6 @@ use crate::steam::SteamDownload;
use async_process::Command;
use serde::Serialize;
use std::{env, fs};
use std::fs::File;
use std::os::unix::fs::PermissionsExt;
use crate::get_os;
@@ -318,7 +317,11 @@ impl Terminal {
// println!("{}", download_script);
fs::write("./script.sh", download_script).unwrap();
fs::set_permissions("./script.sh", fs::Permissions::from_mode(0o755)).unwrap(); // Won't run without executable permission
#[cfg(unix)]
{
fs::set_permissions("./script.sh", fs::Permissions::from_mode(0o755)).unwrap(); // Won't run without executable permission
}
let mut cmd = Command::new("/usr/bin/open");
cmd.args(&["-a", "Terminal", "./script.sh"]);