Compare commits

...

5 Commits

Author SHA1 Message Date
Austen Adler
95c394cbaf Print command after output
Some checks failed
continuous-integration/drone/push Build is failing
2023-02-18 16:23:38 -05:00
Austen Adler
3637091341 Fixes
Some checks failed
continuous-integration/drone/push Build is failing
2022-12-29 15:22:32 -05:00
Austen Adler
4b8087bf8d Try using curl
Some checks failed
continuous-integration/drone/push Build is failing
2022-12-29 15:16:32 -05:00
Austen Adler
3471ea3c0b Print output when done 2022-12-29 15:10:28 -05:00
Austen Adler
bdd28da59e Upload artifacts to registry
Some checks failed
continuous-integration/drone/push Build is failing
2022-12-29 15:09:58 -05:00
2 changed files with 22 additions and 7 deletions

View File

@ -29,7 +29,20 @@ steps:
# source: dist/**/* # source: dist/**/*
# target: live-cli/${DRONE_BUILD_CREATED}-${DRONE_COMMIT} # target: live-cli/${DRONE_BUILD_CREATED}-${DRONE_COMMIT}
- name: Gitea Artifacts - name: Publish Artifacts
image: curlimages/curl
volumes:
- name: dist
path: /dist
environment:
GITEA_SVC_USERNAME:
from_secrete: GITEA_SVC_USERNAME
GITEA_SVC_PASSWORD:
from_secret: GITEA_SVC_PASSWORD
commands:
- sh -c 'set -ex; cd /dist; for f in *; do curl --user "drone-svc:$${GITEA_SVC_PASSWORD}" -X PUT https://gitea.austen-wares.com.com/api/packages/public/generic/$${DRONE_REPO_NAME}/$$(date -Isecond)-$${DRONE_COMMIT}/$${f}; done'
- name: Publish release
image: plugins/gitea-release image: plugins/gitea-release
when: when:
event: event:

View File

@ -190,7 +190,7 @@ fn main() -> Result<()> {
let (message_rx, command_request_tx) = init_message_passing(); let (message_rx, command_request_tx) = init_message_passing();
// Run the actual application // Run the actual application
let app = App::new(message_rx, command_request_tx, text_orig); let mut app = App::new(message_rx, command_request_tx, text_orig);
enable_raw_mode()?; enable_raw_mode()?;
let mut stdout = io::stdout(); let mut stdout = io::stdout();
execute!( execute!(
@ -202,7 +202,7 @@ fn main() -> Result<()> {
let backend = CrosstermBackend::new(stdout); let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?; let mut terminal = Terminal::new(backend)?;
let res = run_app(&mut terminal, app); let resulting_commandline = run_app(&mut terminal, &mut app);
// Restore terminal // Restore terminal
disable_raw_mode()?; disable_raw_mode()?;
@ -214,11 +214,13 @@ fn main() -> Result<()> {
)?; )?;
terminal.show_cursor()?; terminal.show_cursor()?;
let res = res?; let resulting_commandline = resulting_commandline?;
if let Some(res) = res { if let Some(resulting_commandline) = resulting_commandline {
std::io::stderr().write_all(res.as_bytes())?; // TODO: I do not want to collect the whole thing into a vec
app.command_options.read().command_result.as_ref().map(|r| std::io::stdout().write_all(&r.stdout.bytes().collect::<Vec<u8>>())).transpose()?;
std::io::stderr().write_all(b"\n")?; std::io::stderr().write_all(b"\n")?;
std::io::stderr().write_all(resulting_commandline.as_bytes())?;
} }
Ok(()) Ok(())
@ -248,7 +250,7 @@ fn init_message_passing() -> (Receiver<EventMessage>, Sender<CommandRequest>) {
#[allow(clippy::too_many_lines)] #[allow(clippy::too_many_lines)]
#[cfg_attr(debug_assertions, instrument(skip(terminal, app)))] #[cfg_attr(debug_assertions, instrument(skip(terminal, app)))]
fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> Result<Option<String>> { fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> Result<Option<String>> {
// When starting the app, ensure the command runs at least once // When starting the app, ensure the command runs at least once
{ {
let mut command_options = app.command_options.write(); let mut command_options = app.command_options.write();