-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* display git hash in marketplace show and app show. Add additional info to app show * bump marketplace lib version * disbaled links if site not provided, fix bug with license-instructions * fix import * stupid * feat: Add in the packing side git hash * chore: Remove the test that is breaking the build. Co-authored-by: Matt Hill <matthewonthemoon@gmail.com> Co-authored-by: BluJ <mogulslayer@gmail.com>
- Loading branch information
1 parent
36278b6
commit f2bf535
Showing
14 changed files
with
245 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use std::path::Path; | ||
|
||
use crate::Error; | ||
|
||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] | ||
pub struct GitHash(String); | ||
|
||
impl GitHash { | ||
pub async fn from_path(path: impl AsRef<Path>) -> Result<GitHash, Error> { | ||
let hash = tokio::process::Command::new("git") | ||
.args(["describe", "--always", "--abbrev=40", "--dirty=-modified"]) | ||
.current_dir(path) | ||
.output() | ||
.await?; | ||
if !hash.status.success() { | ||
return Err(Error::new( | ||
color_eyre::eyre::eyre!("Could not get hash: {}", String::from_utf8(hash.stderr)?), | ||
crate::ErrorKind::Filesystem, | ||
)); | ||
} | ||
Ok(GitHash(String::from_utf8(hash.stdout)?)) | ||
} | ||
} | ||
|
||
impl AsRef<str> for GitHash { | ||
fn as_ref(&self) -> &str { | ||
&self.0 | ||
} | ||
} | ||
|
||
// #[tokio::test] | ||
// async fn test_githash_for_current() { | ||
// let answer: GitHash = GitHash::from_path(std::env::current_dir().unwrap()) | ||
// .await | ||
// .unwrap(); | ||
// let answer_str: &str = answer.as_ref(); | ||
// assert!( | ||
// !answer_str.is_empty(), | ||
// "Should have a hash for this current working" | ||
// ); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ | |
"dependencies": { | ||
"tslib": "^2.3.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...es/apps-routes/app-show/components/app-show-additional/app-show-additional.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<ion-item-divider>Additional Info</ion-item-divider> | ||
<ion-card *ngIf="pkg.manifest as manifest"> | ||
<ion-grid> | ||
<ion-row> | ||
<ion-col sizeXs="12" sizeMd="6"> | ||
<ion-item-group> | ||
<ion-item> | ||
<ion-label> | ||
<h2>Version</h2> | ||
<p>{{ manifest.version | displayEmver }}</p> | ||
</ion-label> | ||
</ion-item> | ||
<ion-item button detail="false" (click)="copy(manifest['git-hash'])"> | ||
<ion-label> | ||
<h2>Git Hash</h2> | ||
<p>{{ manifest['git-hash'] }}</p> | ||
</ion-label> | ||
<ion-icon slot="end" name="copy-outline"></ion-icon> | ||
</ion-item> | ||
<ion-item button detail="false" (click)="presentModalLicense()"> | ||
<ion-label> | ||
<h2>License</h2> | ||
<p>{{ manifest.license }}</p> | ||
</ion-label> | ||
<ion-icon slot="end" name="chevron-forward"></ion-icon> | ||
</ion-item> | ||
</ion-item-group> | ||
</ion-col> | ||
<ion-col sizeXs="12" sizeMd="6"> | ||
<ion-item-group> | ||
<ion-item | ||
[href]="manifest['upstream-repo']" | ||
target="_blank" | ||
rel="noreferrer" | ||
detail="false" | ||
> | ||
<ion-label> | ||
<h2>Source Repository</h2> | ||
<p>{{ manifest['upstream-repo'] }}</p> | ||
</ion-label> | ||
<ion-icon slot="end" name="open-outline"></ion-icon> | ||
</ion-item> | ||
<ion-item | ||
[href]="manifest['wrapper-repo']" | ||
target="_blank" | ||
rel="noreferrer" | ||
detail="false" | ||
> | ||
<ion-label> | ||
<h2>Wrapper Repository</h2> | ||
<p>{{ manifest['wrapper-repo'] }}</p> | ||
</ion-label> | ||
<ion-icon slot="end" name="open-outline"></ion-icon> | ||
</ion-item> | ||
<ion-item | ||
[href]="manifest['support-site']" | ||
[disabled]="!manifest['support-site']" | ||
target="_blank" | ||
rel="noreferrer" | ||
detail="false" | ||
> | ||
<ion-label> | ||
<h2>Support Site</h2> | ||
<p>{{ manifest['support-site'] || 'Not provided' }}</p> | ||
</ion-label> | ||
<ion-icon slot="end" name="open-outline"></ion-icon> | ||
</ion-item> | ||
</ion-item-group> | ||
</ion-col> | ||
</ion-row> | ||
</ion-grid> | ||
</ion-card> |
Oops, something went wrong.