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

skip copy workbook in loc if exist #576

Merged
merged 1 commit into from
Jan 29, 2020
Merged

Conversation

vutran01
Copy link
Contributor

sometimes loc branches are missing some .json and .workbook files so the script copies them from master to loc branches when processing the templates. however, when the .workbook filename changes, this process could copy and have multiple .workbook in a directory and the tool will fail. this fix will check if .workbook already exist in the loc branches and skip copying another .workbook file over

@austonli austonli merged commit 9dc8ebb into master Jan 29, 2020
@@ -256,6 +256,14 @@ Function CopyFromEnuIfNotExist() {
$fileName = $enuFile.Name
$destinationFile = "$fullName\$fileName"
if (!(Test-Path $destinationFile)) {
if ($fileName -like "*.workbook") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments would be good. if I interpret this right, it is skipping files from the localized repo if the same file name doesn't exist in the English one?

so in this case, should the output show >>>>> skipping... and then just below it show [#Warning: missing file]… ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the build I see this:
[INFO] [133] >>>>>>>>>>>>>>>>>> Skipping .workbook in S:\scripts\Application-Insights-Workbooks.cs-cz\Workbooks\View Designer\View Designer Transition Guide\Transition Guide.workbook <<<<<<<<

[INFO] [134] >>>>>>>>>>>>>>>>>> Skipping .workbook in S:\scripts\Application-Insights-Workbooks.cs-cz\Workbooks\View Designer\View Designer Transition Guide\Transition Guide.workbook <<<<<<<<

[INFO] [135] [#WARNING: missing File]: copying file S:\Workbooks\Virtual Machine Scale Sets - Network Dependencies\categoryResources.json to S:\scripts\Application-Insights-Workbooks.cs-cz\Workbooks\Virtual Machine Scale Sets - Network Dependencies

[INFO] [136] [#WARNING: missing File]: ...found S:\scripts\Application-Insights-Workbooks.cs-cz\Workbooks\Virtual Machine Scale Sets - Network Dependencies\categoryResources.json and replacing "en-us" with "cs-cz"

which implies to me that it skipped the file completely, does that mean that the English one won't be there in this language either? or does some other process handle that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will add more comments.

for the file that's missing in Loc compared with Enu, this checks that .workbook is the missing file and then get all .workbook files in the Loc folder to see if there's already a .workbook in that folder and skip processing. current folder ($fullname) is the Loc branch it's processing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skipping means it detected another .workbook in the Loc branch so it won't copy over the enu version; this means the Loc branch will use an older .workbook version until the next time loc process sync the files from master. missing file indicates it detected missing files in Loc branch compared with enu and it's copying over that file before merging into a final json file

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

Successfully merging this pull request may close these issues.

None yet

3 participants