Skip to content

Commit

Permalink
added comments notes
Browse files Browse the repository at this point in the history
  • Loading branch information
synle committed Jul 29, 2023
1 parent e24273e commit b36b038
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .build/sublime-text-configurations
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Preferences Settings

{
"update_check": false,
"atomic_save": true,
Expand Down
2 changes: 2 additions & 0 deletions .build/sublime-text-keybindings-linux
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Preferences Key Bindings

[
{
"keys": [
Expand Down
2 changes: 2 additions & 0 deletions .build/sublime-text-keybindings-macosx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Preferences Key Bindings

[
{
"keys": [
Expand Down
2 changes: 2 additions & 0 deletions .build/sublime-text-keybindings-windows
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Preferences Key Bindings

[
{
"keys": [
Expand Down
2 changes: 2 additions & 0 deletions .build/vs-code-configurations
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Preferences Open User Settings (JSON)

{
"breadcrumbs.enabled": true,
"editor.bracketPairColorization.enabled": true,
Expand Down
2 changes: 2 additions & 0 deletions .build/vs-code-keybindings-linux
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Preferences Open Keyboard Shortcuts (JSON)

[
{
"key": "alt+1",
Expand Down
2 changes: 2 additions & 0 deletions .build/vs-code-keybindings-macosx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Preferences Open Keyboard Shortcuts (JSON)

[
{
"key": "cmd+1",
Expand Down
2 changes: 2 additions & 0 deletions .build/vs-code-keybindings-windows
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Preferences Open Keyboard Shortcuts (JSON)

[
{
"key": "alt+1",
Expand Down
18 changes: 13 additions & 5 deletions software/base-node-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,27 @@ function backupText(aDir, text) {
}
}

function writeJson(aDir, json) {
writeText(aDir, JSON.stringify(json, null, 2));
function writeJson(aDir, json, comments = '') {
let content = comments + '\n' + JSON.stringify(json, null, 2);
writeText(aDir, content.trim());
}

function writeToBuildFile(tasks) {
if (DEBUG_WRITE_TO_DIR) {
for (const [file, data, isJson = false] of [].concat(tasks)) {
for (let [file, data, isJson, comments] of [].concat(tasks)) {
isJson = !!isJson || false;
comments = comments || '';

if (comments) {
comments += '\n';
}

if (isJson) {
console.log(consoleLogColor1(' >> DEBUG Mode: write JSON to file'), consoleLogColor4(file));
writeJson(file, data);
writeJson(file, data, comments);
} else {
console.log(consoleLogColor1(' >> DEBUG Mode: write TEXT to file'), consoleLogColor4(file));
writeText(file, data);
writeText(file, (comments + data).trim());
}
}
return process.exit();
Expand Down
3 changes: 2 additions & 1 deletion software/scripts/sublime-text-configurations.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ async function doWork() {
console.log(` >> Setting up Sublime Text configurations:`, consoleLogColor4(targetPath));

// write to build file
writeToBuildFile([['sublime-text-configurations', sublimeSetings, true]]);
const commentNote = '// Preferences Settings';
writeToBuildFile([['sublime-text-configurations', sublimeSetings, true, commentNote]]);

if (!filePathExist(targetPath)) {
console.log(consoleLogColor1(' >> Skipped : Not Found'));
Expand Down
12 changes: 9 additions & 3 deletions software/scripts/sublime-text-keybindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,16 @@ async function doWork() {
console.log(` >> Setting up Sublime Text Keybindings:`, consoleLogColor4(targetPath));

// write to build file
const commentNote = '// Preferences Key Bindings';
writeToBuildFile([
['sublime-text-keybindings-windows', _formatKey([...COMMON_KEY_BINDINGS, ...WINDOWS_ONLY_KEY_BINDINGS], WINDOWS_OS_KEY), true],
['sublime-text-keybindings-linux', _formatKey([...COMMON_KEY_BINDINGS, ...LINUX_ONLY_KEYBINDING], LINUX_OS_KEY), true],
['sublime-text-keybindings-macosx', _formatKey([...COMMON_KEY_BINDINGS, ...MAC_ONLY_KEY_BINDINGS], MAC_OSX_KEY), true],
[
'sublime-text-keybindings-windows',
_formatKey([...COMMON_KEY_BINDINGS, ...WINDOWS_ONLY_KEY_BINDINGS], WINDOWS_OS_KEY),
true,
commentNote,
],
['sublime-text-keybindings-linux', _formatKey([...COMMON_KEY_BINDINGS, ...LINUX_ONLY_KEYBINDING], LINUX_OS_KEY), true, commentNote],
['sublime-text-keybindings-macosx', _formatKey([...COMMON_KEY_BINDINGS, ...MAC_ONLY_KEY_BINDINGS], MAC_OSX_KEY), true, commentNote],
]);

if (!filePathExist(targetPath)) {
Expand Down
3 changes: 2 additions & 1 deletion software/scripts/vs-code-configurations.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ async function doWork() {
let targetFile;

// write to build file
writeToBuildFile([['vs-code-configurations', COMMON_CONFIGS, true]]);
const commentNote = '// Preferences Open User Settings (JSON)';
writeToBuildFile([['vs-code-configurations', COMMON_CONFIGS, true, commentNote]]);

if (!filePathExist(targetPath)) {
console.log('Not supported - Exit - targetPath not found: ', consoleLogColor4(targetPath));
Expand Down
6 changes: 4 additions & 2 deletions software/scripts/vs-code-keybindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,16 @@ async function doWork() {
let targetFile;

// write to build file
const commentNote = '// Preferences Open Keyboard Shortcuts (JSON)';
writeToBuildFile([
['vs-code-keybindings-windows', _formatKey([...COMMON_KEY_BINDINGS, ...WINDOWS_ONLY_KEY_BINDINGS], WINDOWS_OS_KEY), true],
['vs-code-keybindings-windows', _formatKey([...COMMON_KEY_BINDINGS, ...WINDOWS_ONLY_KEY_BINDINGS], WINDOWS_OS_KEY), true, commentNote],
[
'vs-code-keybindings-linux',
_formatKey([...COMMON_KEY_BINDINGS, ...WINDOWS_ONLY_KEY_BINDINGS, ...LINUX_ONLY_KEYBINDING], LINUX_OS_KEY),
true,
commentNote,
],
['vs-code-keybindings-macosx', _formatKey([...COMMON_KEY_BINDINGS, ...MAC_ONLY_KEY_BINDINGS], MAC_OSX_KEY), true],
['vs-code-keybindings-macosx', _formatKey([...COMMON_KEY_BINDINGS, ...MAC_ONLY_KEY_BINDINGS], MAC_OSX_KEY), true, commentNote],
]);

if (!filePathExist(targetPath)) {
Expand Down

0 comments on commit b36b038

Please sign in to comment.