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

const fs = require('fs');
const args = process.argv.slice(2);
const notesDir = `${process.env.HOME}/.notables`;
const location = `${notesDir}/${process.cwd().replace(/\//g, '-')}`;

if (args.join(' ') == 'clear all') {
  removeFiles(no)
} else if (args[0] == 'clear') {
  removeFile(location);
  console.log('note removed')
} else if (args.length > 0) {
  if (!fs.existsSync(notesDir)) {
    fs.mkdirSync(notesDir);
  }
  let now = new Date();
  let parts = now.toString().split(' ');
  let date = `${parts[0]}, ${parts[1]} ${parts[[2]]} ${parts[3]} ${parts[4]}`;
  fs.writeFileSync(location, `${date}\n${args.join(' ')}`);
  console.log('note saved');
} else {
  if (fs.existsSync(location)) {
    console.log(fs.readFileSync(location).toString());
  } else {
    console.log('nothing here');
  }
}

function removeFiles(dir) {
  try {
    var files = fs.readdirSync(dir);
  } catch (e) {
    return;
  }
  files.forEach(f => {
    removeFile(`${dir}/${f}`);
  });
};

function removeFile(path) {
  if (fs.statSync(path).isFile()) {
    fs.unlinkSync(path);
  }
}
<commit_msg>fixed notable directory<commit_after>#!/usr/bin/env node

/**
 * Command line utility for leaving notes for yourself in the terminal.
 *
 * @author <NAME> <EMAIL>
 */

'use strict'

const fs = require('fs');
const args = process.argv.slice(2);
const notesDir = `${process.env.HOME}/.notable`;
const location = `${notesDir}/${process.cwd().replace(/\//g, '-')}`;

if (args.join(' ') == 'clear all') {
  removeFiles(notesDir);
} else if (args[0] == 'clear') {
  removeFile(location);
  console.log('note removed')
} else if (args.length > 0) {
  if (!fs.existsSync(notesDir)) {
    fs.mkdirSync(notesDir);
  }
  let now = new Date();
  let parts = now.toString().split(' ');
  let date = `${parts[0]}, ${parts[1]} ${parts[[2]]} ${parts[3]} ${parts[4]}`;
  fs.writeFileSync(location, `${date}\n${args.join(' ')}`);
  console.log('note saved');
} else {
  if (fs.existsSync(location)) {
    console.log(fs.readFileSync(location).toString());
  } else {
    console.log('nothing here');
  }
}

function removeFiles(dir) {
  try {
    var files = fs.readdirSync(dir);
  } catch (e) {
    return;
  }
  files.forEach(f => {
    removeFile(`${dir}/${f}`);
  });
};

function removeFile(path) {
  if (fs.statSync(path).isFile()) {
    fs.unlinkSync(path);
  }
}

{'fraction_non_alphanumeric': 0.22696534234995774, 'fraction_numerical': 0.006762468300929839, 'mean_word_length': 3.8603696098562628, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2294894', 'n_tokens_mistral': 874, 'n_tokens_neox': 879, 'n_words': 166}