File tree 3 files changed +38
-43
lines changed
3 files changed +38
-43
lines changed Original file line number Diff line number Diff line change 10
10
using System . Linq ;
11
11
using System ;
12
12
using System . IO ;
13
+ using Serilog ;
13
14
14
15
[ UnsetVisualStudioEnvironmentVariables ]
15
16
partial class Build : NukeBuild
@@ -100,6 +101,36 @@ partial class Build : NukeBuild
100
101
RootDirectory / "matrix.json" ,
101
102
JsonConvert . SerializeObject ( matrix ) ) ;
102
103
} ) ;
104
+
105
+ Target Accept => _ => _
106
+ . Executes ( ( ) =>
107
+ {
108
+ foreach ( var mismatchDir in Directory . GetDirectories (
109
+ RootDirectory , "__MISMATCH__" , SearchOption . AllDirectories ) )
110
+ {
111
+ Log . Information ( "Analyzing {0} ..." , mismatchDir ) ;
112
+
113
+ var snapshotDir = Directory . GetParent ( mismatchDir ) ! . FullName ;
114
+ foreach ( var mismatch in Directory . GetFiles (
115
+ mismatchDir , "*.*" , SearchOption . TopDirectoryOnly ) )
116
+ {
117
+ var snapshot = Path . Combine ( snapshotDir , Path . GetFileName ( mismatch ) ) ;
118
+ if ( File . Exists ( snapshot ) )
119
+ {
120
+ File . Delete ( snapshot ) ;
121
+ File . Move ( mismatch , snapshot ) ;
122
+ }
123
+ }
124
+
125
+ foreach ( var mismatch in Directory . GetFiles (
126
+ mismatchDir , "*.*" , SearchOption . AllDirectories ) )
127
+ {
128
+ File . Delete ( mismatch ) ;
129
+ }
130
+
131
+ Directory . Delete ( mismatchDir , true ) ;
132
+ }
133
+ } ) ;
103
134
}
104
135
105
136
Original file line number Diff line number Diff line change
1
+ :; set -eo pipefail
2
+ :; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
3
+ :; ${SCRIPT_DIR}/accept.sh "$@"
4
+ :; exit $?
5
+
6
+ ./build.cmd accept
Original file line number Diff line number Diff line change 1
1
#! /bin/zsh
2
2
3
- # Use a variable to keep track of whether any directories were found
4
- found_mismatch=false
5
-
6
- # Use a variable to check if the header has been printed
7
- header_printed=false
8
-
9
- # Find all __MISMATCH__ folders
10
- find . -type d -name " __MISMATCH__" | while read mismatch_dir; do
11
- # Mark that we found a mismatch directory
12
- found_mismatch=true
13
-
14
- # Get the parent __snapshots__ directory
15
- snapshot_dir=" $( dirname " $mismatch_dir " ) "
16
-
17
- # If there are files in the directory, copy them
18
- if [ " $( ls -A " $mismatch_dir " ) " ]; then
19
- for file in " $mismatch_dir " /* ; do
20
- if [ -f " $file " ]; then
21
- cp " $file " " $snapshot_dir /"
22
-
23
- # Print the header only once
24
- if [ " $header_printed " = false ]; then
25
- echo " Found Updated Snapshots:"
26
- header_printed=true
27
- fi
28
-
29
- # Extract relevant path details and print
30
- relative_path=" ${snapshot_dir# ./ src/ HotChocolate/ } " # strip the common prefix
31
- echo " - $relative_path /$( basename " $file " ) "
32
- fi
33
- done
34
- fi
35
-
36
- # Remove the __MISMATCH__ directory
37
- rm -r " $mismatch_dir "
38
- done
39
-
40
- # Check if any directories were found
41
- if [ " $found_mismatch " = false ]; then
42
- echo " All snapshots are up to date!"
43
- else
44
- echo " \nDone!"
45
- fi
3
+ ./build.sh accept
You can’t perform that action at this time.
0 commit comments