Skip to content

Commit

Permalink
Merge pull request #69 from bow-swift/fix-bug-logictree
Browse files Browse the repository at this point in the history
Fix general bugs
  • Loading branch information
miguelangel-dev authored Jun 24, 2019
2 parents dd6156c + 128c97e commit 570e589
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 15 deletions.
5 changes: 2 additions & 3 deletions bin/nef-carbon
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ buildCarbon() {

playgrounds "$projectPath"

for playground in "${playgrounds[@]}"; do
playgroundName=`echo "$playground" | rev | cut -d'/' -f -1 | cut -d'.' -f 2- | rev`
playgroundPath="$projectPath/$playground"
for playgroundPath in "${playgroundsPaths[@]}"; do
playgroundName=`echo "$playgroundPath" | rev | cut -d'/' -f -1 | cut -d'.' -f 2- | rev`
output="$outputPath/$playgroundName"

echo "${normal}Downloading Carbon's snippets for ${green}$playgroundName${reset}"
Expand Down
22 changes: 18 additions & 4 deletions bin/nef-common
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

##
# playgrounds(String folder)
# playgrounds(String folder) throws
# - Parameter `folder`: path to the project folder.
# - Return `playgrounds` list of the playgrounds given a project path.
##
playgrounds() {
local path="$1" # parameter `folder`
local root="$1" # parameter `folder`

workspace=$(workspaceForProjectPath "$1")
content="$workspace/contents.xcworkspacedata"
Expand All @@ -18,11 +18,25 @@ playgrounds() {
playgrounds=`echo "$playgrounds" | tr -s '\n' '\t'` # '\n' -> '\t'
IFS=$'\t' read -r -a playgrounds <<< "$playgrounds" # split by '\t'

declare -p playgrounds 1>/dev/null 2>/dev/null
# build playground path
playgroundsPaths=()
for playground in "${playgrounds[@]}"; do
if [ -d "$playground" ]; then
playgroundsPaths+=("$playground")
elif [ -d "$root/$playground" ]; then
playgroundsPaths+=("$root/$playground")
else
echo ""
echo "${bold}${red}error: ${reset}file '$playground' does not exist. Please, review if this playground is linked properly."
exit 1
fi
done

declare -p playgroundsPaths 1>/dev/null 2>/dev/null
}

##
# pagesInPlayground(String playground)
# pagesInPlayground(String playground) throws
# - Parameter `playground`: path to the playground where to get its pages.
# - Return `pagesInPlayground` list of the playground's pages given a playground.
##
Expand Down
6 changes: 2 additions & 4 deletions bin/nef-jekyll
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ buildMicrosite() {

echo "options:" > "$sidebarFilePath" # sidebar start

for playground in "${playgrounds[@]}"; do

playgroundName=`echo "$playground" | rev | cut -d'/' -f -1 | cut -d'.' -f 2- | rev`
playgroundPath="$projectPath/$playground"
for playgroundPath in "${playgroundsPaths[@]}"; do
playgroundName=`echo "$playgroundPath" | rev | cut -d'/' -f -1 | cut -d'.' -f 2- | rev`

echo -ne "${normal}Rendering jekyll files for ${green}Playground ($playgroundName)${reset}..."
pagesInPlayground "$playgroundPath"
Expand Down
5 changes: 2 additions & 3 deletions bin/nef-markdown
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ buildMarkdown() {

playgrounds "$projectPath"

for playground in "${playgrounds[@]}"; do
playgroundName=`echo "$playground" | rev | cut -d'/' -f -1 | cut -d'.' -f 2- | rev`
playgroundPath="$projectPath/$playground"
for playgroundPath in "${playgroundsPaths[@]}"; do
playgroundName=`echo "$playgroundPath" | rev | cut -d'/' -f -1 | cut -d'.' -f 2- | rev`
output="$outputPath/$playgroundName"

echo -ne "${normal}Rendering Markdown files for ${green}$playgroundName${reset}..."
Expand Down
2 changes: 1 addition & 1 deletion markdown/Carbon/App/CarbonWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CarbonWebView: WKWebView, WKNavigationDelegate, CarbonView {
guard let carbon = carbon else { didFailLoadingCarbonWebView(); return }
let request = urlRequest(from: carbon)

Timer.scheduledTimer(withTimeInterval: 3.0, repeats: false) { _ in
Timer.scheduledTimer(withTimeInterval: 3.5, repeats: false) { _ in
self.launch(carbonRequest: request)
}
}
Expand Down

0 comments on commit 570e589

Please sign in to comment.