File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -88,3 +88,36 @@ export async function getChanges() {
8888 }
8989 return allChanges ;
9090}
91+
92+
93+ /**
94+ * Get a value from the Git config.
95+ *
96+ * The CLI will assume local (project) project by default.
97+ */
98+ export async function _getConfigValue ( options : string [ ] ) {
99+ const cmd = "config"
100+
101+ const { stdout, stderr } = await _execute (
102+ getWorkspaceFolder ( ) ,
103+ cmd ,
104+ options
105+ ) ;
106+
107+ if ( stderr ) {
108+ console . debug ( `stderr for 'git ${ cmd } ' command:` , stderr ) ;
109+ }
110+
111+ return stdout
112+ }
113+
114+ /**
115+ * Get the configured value for a commit template path if set, or empty string.
116+ */
117+ export async function getCommitTemplateName ( ) {
118+ try {
119+ return await _getConfigValue ( [ 'commit.template' ] )
120+ } catch ( _e ) {
121+ return ""
122+ }
123+ }
You can’t perform that action at this time.
0 commit comments