Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
acoustep committed May 9, 2020
1 parent 4f7f72d commit e58aca6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 24 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sudo snap install snipcli --beta

### From source

Snipline CLI requires Crystal 0.30.1 to be installed to install from source
Snipline CLI requires Crystal 0.34.0 to be installed to install from source

```bash
# Clone the repo
Expand All @@ -37,9 +37,9 @@ git checkout <tagname - e.g. 0.3.1>
crystal -v
# Install dependencies
shards
# Build app for Crystal 0.32.1 / MacOS
# Build app for Crystal 0.34.0 / MacOS
crystal build src/snipline_cli.cr -o snipcli --release -o snipcli
# Build app for Crystal 0.31.1 / Linux (Alpine)
# Build app for Crystal 0.34.0 / Linux (Alpine)
crystal build src/snipline_cli.cr -o snipcli --release -o snipcli -Dstatic_linux
./snipcli --version
```
Expand Down
3 changes: 2 additions & 1 deletion src/snipline_cli/services/create_config_directory.cr
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
require "../helpers/*"

module SniplineCli
module Services
# Creates a config directory for storing configuration files for SnipCLI.
class CreateConfigDirectory
def self.run(file)
directory_name = SniplineCli::Helpers.expand_path(File.dirname(file))
directory_name = SniplineCli::Helpers.expand_path(File.dirname(file))
unless File.directory?(directory_name)
Log.debug { "Making config directory #{directory_name}" }
Dir.mkdir(directory_name)
Expand Down
38 changes: 19 additions & 19 deletions src/snipline_cli/services/display_results.cr
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module SniplineCli::Services
break if codepoint == 17 # C+q - quit
break if run_character_key(ch, codepoint) == false
@left_pane.filter(@search.search_text)
else
else
end
@search.window.refresh
end
Expand All @@ -55,27 +55,27 @@ module SniplineCli::Services
@left_pane.select_lower
refresh_right_pane
elsif codepoint == 67 || codepoint == 10 # Shift+c / Enter - copy
unless @left_pane.results.size <= 0
output = build_snippet
copy_snippet(output)
return false
end
unless @left_pane.results.size <= 0
output = build_snippet
copy_snippet(output)
return false
end
elsif codepoint == 68 # Shift+d - delete
unless @left_pane.results.size <= 0
delete_snippet
return false
end
unless @left_pane.results.size <= 0
delete_snippet
return false
end
elsif codepoint == 69 # Shift+e - edit
unless @left_pane.results.size <= 0
edit_snippet
return false
end
unless @left_pane.results.size <= 0
edit_snippet
return false
end
elsif codepoint == 82 # Shift+r - run
unless @left_pane.results.size <= 0
output = build_snippet
run_snippet(output)
return false
end
unless @left_pane.results.size <= 0
output = build_snippet
run_snippet(output)
return false
end
else
@search.write(ch)
@left_pane.filter(@search.search_text)
Expand Down
2 changes: 1 addition & 1 deletion src/snipline_cli/services/snipline_api.cr
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module SniplineCli::Services
# "Accept" => "application/vnd.api+json",
"Authorization" => "Bearer #{config.get("api.token")}",
},
logging: ENV["CRYSTAL_LOG_LEVEL"] == "DEBUG" ? true : false
logging: ENV["CRYSTAL_LOG_LEVEL"] == "DEBUG" ? true : false
)
true
rescue ex
Expand Down

0 comments on commit e58aca6

Please sign in to comment.