Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cider log multiline message problem #81

Open
biancashouse opened this issue Oct 8, 2024 · 4 comments
Open

cider log multiline message problem #81

biancashouse opened this issue Oct 8, 2024 · 4 comments

Comments

@biancashouse
Copy link

I'm using Windows and powershell to build ps1 scripts that build upon cider.
When I run this ps1 script:

$logMessage = 'make Cider great again
and line 2'

cider log fixed $logMessage

The CHANGELOG.md gets an entry that looks like this:

  • make Cider great again & C:\Installs\flutter_windows_3.19.1-stable\flutter/bin/internal/exit_with_errorlevel.bat

Anything after line 1 is lost.

Just saying...
Would be nice to be able to add multiline.
Or am I barking up the wrong tree ?

@biancashouse
Copy link
Author

My bad. No bug. This worked:

import 'package:cider/cider.dart';

dart'''
main() {
final cider = CiderCli();
cider.run(['log', 'fixed', "Tried to fix a bug\nbut it was'nt there\nThey're eating the dawgs!!"]);
}
'''

@biancashouse
Copy link
Author

biancashouse commented Oct 8, 2024

Final comment, and reopening so you might incorporate into next release...

I find that in powershell, if I remove newline chars and leave the line feed chars, the problem is resolved:

$stringWithoutLineBreaks = $ciderLogMsg.Replace("`n", "")
cider log "$ciderLogType" "$stringWithoutLineBreaks"

@f3ath
Copy link
Owner

f3ath commented Oct 9, 2024

Hi @biancashouse . I'm wondering if changing your initial command to cider log fixed "$logMessage" will work as expected. Note the quotes around the argument. My suspicion is that the issue is not in Cider, but rather in how the multiline argument is interpreted by the shell.

f3ath@fw:~/project/cider$ logMessage="make
cider
great
covfefe"
f3ath@fw:~/project/cider$ cider log add "$logMessage"
f3ath@fw:~/project/cider$ head CHANGELOG.md -n 15
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- make
cider
great
covfefe

## [0.2.8] - 2024-06-09
### Changed
f3ath@fw:~/project/cider$ 

@f3ath f3ath reopened this Oct 9, 2024
@biancashouse
Copy link
Author

biancashouse commented Oct 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants