Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding a XAML reformatter/beautifier tool to help ensure that we can …
…have all XAML files formatted and cleaned consistently.
- Loading branch information
1 parent
39f6147
commit 19fd245
Showing
5 changed files
with
43 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
var beautify = require('xml-beautifier'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
|
||
const xml = beautify('<div><span>foo</span></div>'); | ||
console.log(xml); // => will output correctly indented elements | ||
|
||
var xaml_list = [].concat(process.argv).slice(2); | ||
console.log(xaml_list); | ||
|
||
foreach(var source_file in xaml_list) { | ||
console.log(`processing file ${source_file}:"); | ||
var src = fs.readFileSync(source_file, 'utf8'); | ||
var dst = beautify(src); | ||
fs.writeFileSync(source_file, dst, 'utf8'); | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 @@ | ||
#! /bin/bash | ||
# | ||
|
||
find . -type f -iname '*.xaml' | xargs node Qiqqa.Build/beautify-xaml.js | ||
|