Issue #8 allow empty strings to mean default namespace and package
diff --git a/OpenWhisk.xcodeproj/project.xcworkspace/xcuserdata/pcastro.xcuserdatad/UserInterfaceState.xcuserstate b/OpenWhisk.xcodeproj/project.xcworkspace/xcuserdata/pcastro.xcuserdatad/UserInterfaceState.xcuserstate
deleted file mode 100644
index 482197b..0000000
--- a/OpenWhisk.xcodeproj/project.xcworkspace/xcuserdata/pcastro.xcuserdatad/UserInterfaceState.xcuserstate
+++ /dev/null
Binary files differ
diff --git a/OpenWhisk/OpenWhiskSDK.swift b/OpenWhisk/OpenWhiskSDK.swift
index c627229..e37c6d8 100644
--- a/OpenWhisk/OpenWhiskSDK.swift
+++ b/OpenWhisk/OpenWhiskSDK.swift
@@ -211,10 +211,20 @@
// append namespace and trigger/action path
var syncName = "namespaces/"
+ var namespaceStr = namespace
+
+ if namespace.characters.count == 0 {
+ namespaceStr = "_"
+ }
+
if let package = package {
- syncName = syncName + namespace+"/"+typeStr+"/"+package+"/"+name
+ if package.characters.count == 0 {
+ syncName = syncName + namespaceStr+"/"+typeStr+"/"+name
+ } else {
+ syncName = syncName + namespaceStr+"/"+typeStr+"/"+package+"/"+name
+ }
} else {
- syncName = syncName + namespace+"/"+typeStr+"/"+name
+ syncName = syncName + namespaceStr+"/"+typeStr+"/"+name
}
// if action has results, specify as blocking