<commit_before>#! /usr/bin/env shjs

// Mirrors directories/files on Windows system.

require('shelljs/global');
//yaml = require('js-yaml');
var fs   = require('fs');
var child_process = require('child_process');
var spawn = child_process.spawnSync;

var rsync = exec('rsync -v');
console.log(rsync.output);

// set src=C:\Users\user0\Pictures
// set dst=H:\the\root\of\the\backup\drives\C\Users\user0\Pictures
// robocopy %src% %dst% /E
<commit_msg>Using syspol policy, read environment variables<commit_after>#! /usr/bin/env shjs

// Mirrors directories/files on Windows system.

require('shelljs/global');
//yaml = require('js-yaml');
var fs   = require('fs');
var child_process = require('child_process');
var spawn = child_process.spawnSync;
var PATH_SEPARATOR = ';';

srcPathsEnvKey = "SYSPOL_EXTERNAL_MIRROR_BACKUP_SOURCE_PATH";
dstPathsEnvKey = "SYSPOL_EXTERNAL_MIRROR_BACKUP_DESTINATION_PATH";

srcPaths = process.env[srcPathsEnvKey];
if(typeof(srcPaths) == "undefined") {
  throw Error("Environment variable %" + srcPathsEnvKey + "% is empty/absent");
}
srcPaths = srcPaths.split(PATH_SEPARATOR);

dstPaths = process.env[dstPathsEnvKey];
if(typeof(dstPaths) == "undefined") {
  //throw Error("Environment variable %" + dstPathsEnvKey + "% is empty/absent");
}

srcPaths = srcPaths.map(function(item, index, array) {
  return item.replace(/"/g, '');
});
console.log(srcPaths);


//console.log(process.env.PATH.split(PATH_SEPARATOR));

// var rsync = exec('rsync -v');
// console.log(rsync.output);

// set src=C:\Users\user0\Pictures
// set dst=H:\the\root\of\the\backup\drives\C\Users\user0\Pictures
// robocopy %src% %dst% /E

{'fraction_non_alphanumeric': 0.17032967032967034, 'fraction_numerical': 0.002442002442002442, 'mean_word_length': 5.092936802973978, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5491083', 'n_tokens_mistral': 594, 'n_tokens_neox': 585, 'n_words': 107}