File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -102,14 +102,24 @@ Adding more of your projects to your Directory Profile builds a more complete pi
102
102
103
103
1 . Make sure ` stackmuncher ` executable is placed in a folder included in ` PATH ` environment variable or add its folder to ` PATH ` .
104
104
2 . Check if you have Git hooks already configured: ` git config --get-all init.templatedir `
105
- * _ the query returned a value_ - edit your post-commit templates manually
106
- * _ the query returned nothing_ - add a [ post-commit Git hook] ( https://git-scm.com/docs/githooks#_post_commit ) :
105
+ * _ if the query returned a value_ - edit your post-commit templates manually
106
+ * _ if the query returned nothing_ - add a [ post-commit Git hook] ( https://git-scm.com/docs/githooks#_post_commit ) :
107
+
108
+ #### Shell
107
109
``` bash
108
110
git config --global --add init.templatedir ' ~/.git-templates'
109
111
mkdir -p ~ /.git-templates/hooks
110
112
echo ' stackmuncher --log info 2>&1 >> ~/.stm.log' >> ~ /.git-templates/hooks/post-commit
111
113
chmod a+x ~ /.git-templates/hooks/post-commit
112
114
```
115
+ # ### PowerShell
116
+ ` ` ` bash
117
+ git config --global --add init.templatedir ' ~/.git-templates'
118
+ mkdir -p ~ /.git-templates/hooks
119
+ echo ' #!/bin/sh' >> ~ /.git-templates/hooks/post-commit
120
+ echo ' stackmuncher --log info 2>&1 >> ~/.stm.log' >> ~ /.git-templates/hooks/post-commit
121
+ ` ` `
122
+
113
123
3. Run ` git init` on your existing repos to add the hook from the template.
114
124
* Any new repos or clones will get the hook added by default.
115
125
* Repos with an existing ` hooks/post-commit` file can have the hook added with ` echo ' stackmuncher --log info 2>&1 >> ~/.stm.log' >> .git/hooks/post-commit` . Run it from the root of the project folder.
Original file line number Diff line number Diff line change @@ -347,8 +347,12 @@ pub(crate) async fn new_lib_config_with_defaults(current_dir: PathBuf) -> (LibCo
347
347
)
348
348
} else if cfg ! ( target_os = "windows" ) {
349
349
// apps should store their data in the user profile and the exact location is obtained via an env var
350
- let local_appdata_dir = std:: env:: var ( "HOMEPATH" ) . expect ( "%HOMEPATH% env variable not found" ) ;
351
- let local_appdata_dir = Path :: new ( & local_appdata_dir) ;
350
+ // homedrive would be something like c: and homedir would be `\Users\admin`
351
+ // if homedrive is not used the current active drive is used
352
+ let home_drive = std:: env:: var ( "HOMEDRIVE" ) . expect ( "%HOMEDRIVE% env variable not found" ) ;
353
+ let home_dir = std:: env:: var ( "HOMEPATH" ) . expect ( "%HOMEPATH% env variable not found" ) ;
354
+ let home_dir = [ home_drive, home_dir] . concat ( ) ;
355
+ let local_appdata_dir = Path :: new ( & home_dir) ;
352
356
(
353
357
local_appdata_dir. join ( REPORT_FOLDER_NAME_WIN ) ,
354
358
local_appdata_dir. join ( CONFIG_FOLDER_NAME_WIN ) ,
You can’t perform that action at this time.
0 commit comments