<commit_before>paths = require "./paths"
path = require "path"
sbawn = require("./sbawn")

Help = require "./Help"

class SafariDebug

  listViews: =>
    scriptPath = path.join paths.scriptsDir, "SafariDebugWebViewLister.scpt"

    openSafariDebugWebViewLister = sbawn
      cmd: "osascript"
      args: [scriptPath]

    openSafariDebugWebViewLister.on "exit", () =>
      steroidsCli.debug "SafariDebug started and killed."
      steroidsCli.debug "stderr: " + openSafariDebugWebViewLister.stderr
      steroidsCli.debug "stdout: " + openSafariDebugWebViewLister.stdout

      console.log "\n\n  Found following WebViews in Safari:\n"
      for line in openSafariDebugWebViewLister.stdout.split("\n") when line isnt ""
        console.log "   - #{line}"

      console.log ""

  open: (argument)=>
    scriptPath = path.join paths.scriptsDir, "openSafariDevMenu.scpt"

    openSafariDebug = sbawn
      cmd: "osascript"
      args: [scriptPath, argument]

    openSafariDebug.on "exit", () =>
      steroidsCli.debug "SafariDebug started and killed."
      steroidsCli.debug "stderr: " + openSafariDebug.stderr
      steroidsCli.debug "stdout: " + openSafariDebug.stdout

module.exports = SafariDebug
<commit_msg>Added OS handling for safari debug command<commit_after>paths = require "./paths"
path = require "path"
sbawn = require("./sbawn")

Help = require "./Help"

os = require "os"

class SafariDebug

  listViews: =>
    unless os.type() == "Darwin"
      console.log "Error: Safari Developer Tools debugging requires Mac OS X."
      return false

    scriptPath = path.join paths.scriptsDir, "SafariDebugWebViewLister.scpt"

    openSafariDebugWebViewLister = sbawn
      cmd: "osascript"
      args: [scriptPath]

    openSafariDebugWebViewLister.on "exit", () =>
      steroidsCli.debug "SafariDebug started and killed."
      steroidsCli.debug "stderr: " + openSafariDebugWebViewLister.stderr
      steroidsCli.debug "stdout: " + openSafariDebugWebViewLister.stdout

      console.log "\n\n  Found following WebViews in Safari:\n"
      for line in openSafariDebugWebViewLister.stdout.split("\n") when line isnt ""
        console.log "   - #{line}"

      console.log ""

  open: (argument)=>
    unless os.type() == "Darwin"
      console.log "Error: Safari Developer Tools debugging requires Mac OS X."
      return false

    scriptPath = path.join paths.scriptsDir, "openSafariDevMenu.scpt"

    openSafariDebug = sbawn
      cmd: "osascript"
      args: [scriptPath, argument]

    openSafariDebug.on "exit", () =>
      steroidsCli.debug "SafariDebug started and killed."
      steroidsCli.debug "stderr: " + openSafariDebug.stderr
      steroidsCli.debug "stdout: " + openSafariDebug.stdout

module.exports = SafariDebug

{'fraction_non_alphanumeric': 0.10896501457725948, 'fraction_numerical': 0.0, 'mean_word_length': 3.357142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3844827', 'n_tokens_mistral': 904, 'n_tokens_neox': 863, 'n_words': 203}