diff --git a/bin/nef-jekyll b/bin/nef-jekyll index 40776f3c..32e3f792 100755 --- a/bin/nef-jekyll +++ b/bin/nef-jekyll @@ -219,12 +219,14 @@ makeStructure() { local logPath="$1/$LOG_PATH" # parameter `project` local sitePath="$2" # parameter `site` local sidebarFolderPath="$2/$BASE_SIDEBAR" + local baseJekyllPath="$sitePath/$BASE_JEKYLL" cleanStructure "$logPath" - cleanStructure "$sitePath" + cleanStructure "$baseJekyllPath" mkdir -p "$logPath" mkdir -p "$sidebarFolderPath" + mkdir -p "$baseJekyllPath" } cleanStructure() { diff --git a/bin/nefc b/bin/nefc index 5e0dd2ca..ca5e482b 100755 --- a/bin/nefc +++ b/bin/nefc @@ -185,13 +185,16 @@ buildPODS() { # - Parameter `folder`: path to the project folder. ## addPlaygroundReference() { - cd "$1" - playgroundForProjectPath "$1" + projectPath="$1" + cd "$projectPath" + playgroundForProjectPath "$projectPath" + local logPath="nef/log" local pattern=" <\/FileRef>\n "$tmp" + mv "$tmp" "$workspaceContent" done } @@ -213,6 +220,7 @@ playgroundForProjectPath() { playgroundForProjectPath=() while read -r -d $'\0' playground; do + playground=$(echo "$playground" | sed 's/.\///g') playgroundForProjectPath+=("$playground") done < <(find . -name '*.playground' -print0) diff --git a/lib/Markup/Utils.swift b/lib/Markup/Utils.swift index d917f017..a9b735cb 100644 --- a/lib/Markup/Utils.swift +++ b/lib/Markup/Utils.swift @@ -7,7 +7,7 @@ typealias SubstringType = (ouput: String, range: NSRange) extension String { func substring(pattern: String) -> SubstringType? { - let range = NSRange(location: 0, length: self.utf8.count) + let range = NSRange(location: 0, length: self.count) guard let regex = try? NSRegularExpression(pattern: pattern, options: .caseInsensitive), let match = regex.firstMatch(in: self, options: [], range: range) else { return nil } diff --git a/lib/MarkupTests/MarkupSyntaxTests.swift b/lib/MarkupTests/MarkupSyntaxTests.swift index 3027c60f..e123e99a 100644 --- a/lib/MarkupTests/MarkupSyntaxTests.swift +++ b/lib/MarkupTests/MarkupSyntaxTests.swift @@ -96,12 +96,12 @@ class MarkupSyntaxTests: XCTestCase { let input = """ /*: // nef:begin:hidden - This is a visible markup multiline + This is a visible 👀 markup multiline © // nef:end */ """ - let expected: [Node] = [.markup(description: .some(""), "This is a visible markup multiline\n")] + let expected: [Node] = [.markup(description: .some(""), "This is a visible 👀 markup multiline ©\n")] let result = Markup.SyntaxAnalyzer.parse(content: input)