-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #332 from CorbinWunderlich/master
Add NodeJS-less formatting script
- Loading branch information
Showing
4 changed files
with
57 additions
and
106 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,19 @@ | ||
{ | ||
"indent_size": "2", | ||
"indent_char": " ", | ||
"max_preserve_newlines": "5", | ||
"preserve_newlines": true, | ||
"keep_array_indentation": false, | ||
"break_chained_methods": false, | ||
"indent_scripts": "normal", | ||
"brace_style": "collapse", | ||
"space_before_conditional": true, | ||
"unescape_strings": false, | ||
"jslint_happy": false, | ||
"end_with_newline": true, | ||
"wrap_line_length": "0", | ||
"indent_inner_html": true, | ||
"comma_first": false, | ||
"e4x": false, | ||
"indent_empty_lines": false | ||
} |
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,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Ensure path is passed in | ||
if [ -z "$1" ]; then | ||
echo "No argument supplied, please enter the filepath of the xpra-html5 project" | ||
|
||
exit 1 | ||
fi | ||
|
||
# Ensure path passed in is a folder | ||
if [ ! -d "$1" ]; then | ||
echo "$1 either does not exist or is not a folder, please enter the filepath of the xpra-html5 project" | ||
|
||
exit 1 | ||
fi | ||
|
||
# Check if nix is installed, if it isn't, use the determinate nix installer | ||
if command -v nix 2>&1 >/dev/null; then | ||
echo "Nix is installed, formatting..." | ||
else | ||
echo "Nix is not installed, using Determinate Nix Installer..." | ||
|
||
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \ | ||
sh -s -- install | ||
|
||
echo "Nix has been installed, formatting..." | ||
fi | ||
|
||
nix-shell $1/shell.nix --run " | ||
js-beautify --config $1/.jsbeautifyrc --type js -r $1/html5/js/*.js; | ||
js-beautify --config $1/.jsbeautifyrc --type html -r $1/html5/*.html; | ||
js-beautify --config $1/.jsbeautifyrc --type css -r $1/html5/css/*.css; | ||
" |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
with (import <nixpkgs> {}); | ||
mkShell { | ||
buildInputs = [ nodejs-18_x ]; | ||
let | ||
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05"; | ||
pkgs = import nixpkgs { }; | ||
in pkgs.mkShell { | ||
buildInputs = with pkgs; [ nodePackages.js-beautify ]; | ||
} |